AliRoot Core  edcc906 (edcc906)
AliFMDInput.h
Go to the documentation of this file.
1 #ifndef AliFMDInput_H
2 #define AliFMDInput_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
4  * reserved.
5  *
6  * See cxx source for full Copyright notice
7  */
8 //___________________________________________________________________
9 //
10 // The classes defined here, are utility classes for reading in data
11 // for the FMD. They are put in a seperate library to not polute the
12 // normal libraries. The classes are intended to be used as base
13 // classes for customized class that do some sort of analysis on the
14 // various types of data produced by the FMD.
20 //___________________________________________________________________
31 #include <TNamed.h>
32 #ifndef ROOT_TString
33 # include <TString.h>
34 #endif
35 #ifndef ROOT_TArrayF
36 # include <TArrayF.h>
37 #endif
38 class AliTrackReference;
39 class AliRunLoader;
40 class AliLoader;
41 class AliStack;
42 class AliRun;
43 class AliRawReader;
44 class AliFMDRawReader;
45 class AliFMD;
46 class AliFMDHit;
47 class AliFMDDigit;
48 class AliFMDSDigit;
49 class AliFMDRecPoint;
50 class AliESDEvent;
51 class AliESDFMD;
52 class AliHeader;
53 class TString;
54 class TClonesArray;
55 class TTree;
56 class TGeoManager;
57 class TParticle;
58 class TChain;
59 class TSystemDirectory;
60 
61 //___________________________________________________________________
106 class AliFMDInput : public TNamed
107 {
108 public:
110  enum ETrees {
111  kHits = 1, // Hits
112  kKinematics, // Kinematics (from sim)
113  kDigits, // Digits
114  kSDigits, // Summable digits
115  kHeader, // Header information
116  kRecPoints, // Reconstructed points
117  kESD, // Load ESD's
118  kRaw, // Read raw data
119  kGeometry, // Not really a tree
120  kTrackRefs, // Track references - also for BG study
121  kRawCalib, // Read raws and calibrate them
123  };
125  AliFMDInput();
128  AliFMDInput(const char* gAliceFile);
130  virtual ~AliFMDInput() {}
131 
134  virtual void AddLoad(ETrees tree) { SETBIT(fTreeMask, tree); }
137  virtual void RemoveLoad(ETrees tree) { CLRBIT(fTreeMask, tree); }
139  virtual Int_t NEvents() const;
141  virtual Bool_t IsLoaded(ETrees tree)const { return TESTBIT(fTreeMask, tree); }
154  virtual void SetLoads(UInt_t mask);
162  virtual void SetLoads(const char* mask);
170  virtual const char* LoadedString(Bool_t dataOnly=false) const;
171 
175  virtual Bool_t Init();
181  virtual Bool_t Begin(Int_t event);
186  virtual Bool_t Event();
189  virtual Bool_t End();
192  virtual Bool_t Finish() { return kTRUE; }
195  virtual Bool_t Run(UInt_t maxEvents=0);
196 
200  virtual Bool_t ProcessHits();
204  virtual Bool_t ProcessTrackRefs();
208  virtual Bool_t ProcessTracks();
212  virtual Bool_t ProcessStack();
215  virtual Bool_t ProcessDigits();
219  virtual Bool_t ProcessSDigits();
223  virtual Bool_t ProcessRawDigits();
227  virtual Bool_t ProcessRawCalibDigits();
231  virtual Bool_t ProcessRecPoints();
234  virtual Bool_t ProcessESDs();
237  virtual Bool_t ProcessUsers();
238 
244  virtual Bool_t ProcessHit(AliFMDHit* h, TParticle* p);
250  virtual Bool_t ProcessTrackRef(AliTrackReference* trackRef, TParticle* track);
257  virtual Bool_t ProcessTrack(Int_t i, TParticle* p, AliFMDHit* h);
262  virtual Bool_t ProcessParticle(Int_t i , TParticle* p);
267  virtual Bool_t ProcessDigit(AliFMDDigit* digit);
272  virtual Bool_t ProcessSDigit(AliFMDSDigit* sdigit);
277  virtual Bool_t ProcessRawDigit(AliFMDDigit* digit);
282  virtual Bool_t ProcessRawCalibDigit(AliFMDDigit* digit);
287  virtual Bool_t ProcessRecPoint(AliFMDRecPoint* point);
297  virtual Bool_t ProcessESD(UShort_t d, Char_t r, UShort_t s, UShort_t t,
298  Float_t eta, Float_t mult);
307  virtual Bool_t ProcessUser(UShort_t d, Char_t r, UShort_t s, UShort_t t,
308  Float_t v);
314  static TArrayF MakeLogScale(Int_t n, Double_t min, Double_t max);
315 
318  void SetRawFile(const char* file) { if (file) fRawFile = file; }
319  void SetInputDir(const char* dir) { fInputDir = (dir && dir[0] != '\0')
320  ? dir : "."; }
328  static ETrees ParseLoad(const char* what);
329 protected:
333  : TNamed(o),
334  fGAliceFile(""),
335  fLoader(0),
336  fRun(0),
337  fStack(0),
338  fFMDLoader(0),
339  fReader(0),
340  fFMDReader(0),
341  fFMD(0),
342  fESD(0),
343  fESDEvent(0),
344  fTreeE(0),
345  fTreeH(0),
346  fTreeTR(0),
347  fTreeD(0),
348  fTreeS(0),
349  fTreeR(0),
350  fTreeA(0),
351  fChainE(0),
352  fArrayE(0),
353  fArrayH(0),
354  fArrayTR(0),
355  fArrayD(0),
356  fArrayS(0),
357  fArrayR(0),
358  fArrayA(0),
359  fHeader(0),
360  fGeoManager(0),
361  fTreeMask(0),
362  fRawFile(""),
363  fInputDir("."),
364  fIsInit(kFALSE),
365  fEventCount(0),
366  fNEvents(-1)
367  {}
370  AliFMDInput& operator=(const AliFMDInput&) { return *this; }
381  virtual Float_t GetSignal(UShort_t d, Char_t r, UShort_t s, UShort_t t);
382 
383  static const char* TreeName(ETrees tree, bool shortest=false);
384 
396  static TChain* MakeChain(const char* what, const char* datadir,
397  bool recursive=false);
408  static void ScanDirectory(TSystemDirectory* dir,
409  const TString& olddir,
410  TChain* chain,
411  const char* pattern, bool recursive);
412 
413  TString fGAliceFile; // File name of gAlice file
414  AliRunLoader* fLoader; // Loader of FMD data
415  AliRun* fRun; // Run information
416  AliStack* fStack; // Stack of particles
417  AliLoader* fFMDLoader; // Loader of FMD data
418  AliRawReader* fReader; // Raw data reader
419  AliFMDRawReader* fFMDReader; // FMD raw reader
420  AliFMD* fFMD; // FMD object
421  AliESDFMD* fESD; // FMD ESD data
422  AliESDEvent* fESDEvent; // ESD Event object.
423  TTree* fTreeE; // Header tree
424  TTree* fTreeH; // Hits tree
425  TTree* fTreeTR; // Track Reference tree
426  TTree* fTreeD; // Digit tree
427  TTree* fTreeS; // SDigit tree
428  TTree* fTreeR; // RecPoint tree
429  TTree* fTreeA; // Raw data tree
430  TChain* fChainE; // Chain of ESD's
431  TClonesArray* fArrayE; // Event info array
432  TClonesArray* fArrayH; // Hit info array
433  TClonesArray* fArrayTR; // Hit info array
434  TClonesArray* fArrayD; // Digit info array
435  TClonesArray* fArrayS; // SDigit info array
436  TClonesArray* fArrayR; // Rec points info array
437  TClonesArray* fArrayA; // Raw data (digits) info array
438  AliHeader* fHeader; // Header
439  TGeoManager* fGeoManager; // Geometry manager
440  Int_t fTreeMask; // Which tree's to load
441  TString fRawFile; // Raw input file
442  TString fInputDir; // Input directory
443  Bool_t fIsInit; // Have we been initialized
444  Int_t fEventCount; // Event counter
445  Int_t fNEvents; // The maximum number of events
446  static const ETrees fgkAllLoads[kUser+1]; // List of all possible loads
447  ClassDef(AliFMDInput,0) //Hits for detector FMD
448 };
449 
450 inline Bool_t AliFMDInput::ProcessHit(AliFMDHit*,TParticle*) { return kTRUE; }
452  TParticle*) { return kTRUE; }
453 inline Bool_t AliFMDInput::ProcessTrack(Int_t,TParticle*,
454  AliFMDHit*) { return kTRUE; }
455 inline Bool_t AliFMDInput::ProcessParticle(Int_t,TParticle*) { return kTRUE; }
456 inline Bool_t AliFMDInput::ProcessDigit(AliFMDDigit*) { return kTRUE; }
457 inline Bool_t AliFMDInput::ProcessSDigit(AliFMDSDigit*) { return kTRUE; }
458 inline Bool_t AliFMDInput::ProcessRawDigit(AliFMDDigit*) { return kTRUE; }
459 inline Bool_t AliFMDInput::ProcessRawCalibDigit(AliFMDDigit*) { return kTRUE; }
460 inline Bool_t AliFMDInput::ProcessRecPoint(AliFMDRecPoint*) { return kTRUE; }
461 inline Bool_t AliFMDInput::ProcessESD(UShort_t,Char_t,UShort_t,UShort_t,
462  Float_t,Float_t) { return kTRUE; }
463 inline Bool_t AliFMDInput::ProcessUser(UShort_t,Char_t,UShort_t,UShort_t,
464  Float_t) { return kTRUE; }
465 inline Float_t AliFMDInput::GetSignal(UShort_t, Char_t, UShort_t, UShort_t) {
466  return 0.; }
467 
468 
469 #endif
470 //____________________________________________________________________
471 //
472 // Local Variables:
473 // mode: C++
474 // End:
475 //
476 // EOF
477 //
class for digits
Definition: AliFMDDigit.h:28
virtual Bool_t ProcessSDigit(AliFMDSDigit *sdigit)
Definition: AliFMDInput.h:457
Reconstructed FMD points. It contains the pseudo-inclusive multiplicity.
virtual Bool_t ProcessTracks()
virtual const char * LoadedString(Bool_t dataOnly=false) const
virtual Float_t GetSignal(UShort_t d, Char_t r, UShort_t s, UShort_t t)
Definition: AliFMDInput.h:465
Definition: AliRun.h:27
virtual Bool_t Finish()
Definition: AliFMDInput.h:192
virtual Bool_t ProcessTrack(Int_t i, TParticle *p, AliFMDHit *h)
Definition: AliFMDInput.h:453
virtual Bool_t ProcessRecPoints()
TTree * fTreeR
Definition: AliFMDInput.h:428
virtual Bool_t ProcessHits()
virtual Bool_t IsLoaded(ETrees tree) const
Definition: AliFMDInput.h:141
virtual void SetLoads(UInt_t mask)
TGeoManager * fGeoManager
Definition: AliFMDInput.h:439
static const char * TreeName(ETrees tree, bool shortest=false)
AliFMDInput & operator=(const AliFMDInput &)
Definition: AliFMDInput.h:370
Class to read ALTRO formated raw data from an AliRawReader object.
static const ETrees fgkAllLoads[kUser+1]
Definition: AliFMDInput.h:446
TTree * fTreeD
Definition: AliFMDInput.h:426
virtual ~AliFMDInput()
Definition: AliFMDInput.h:130
Float_t p[]
Definition: kNNTest.C:133
virtual Bool_t Begin(Int_t event)
AliLoader * fFMDLoader
Definition: AliFMDInput.h:417
virtual Bool_t ProcessHit(AliFMDHit *h, TParticle *p)
Definition: AliFMDInput.h:450
virtual Bool_t Event()
AliRunLoader * fLoader
Definition: AliFMDInput.h:414
Forward Multiplicity Detector based on Silicon wafers. This class is the driver for especially simula...
Definition: AliFMD.h:306
TChain * chain
TTree * fTreeE
Definition: AliFMDInput.h:423
static ETrees ParseLoad(const char *what)
AliTPCfastTrack * track
TChain * fChainE
Definition: AliFMDInput.h:430
TTree * tree
void SetInputDir(const char *dir)
Definition: AliFMDInput.h:319
TString fInputDir
Definition: AliFMDInput.h:442
AliHeader * fHeader
Definition: AliFMDInput.h:438
AliFMDRawReader * fFMDReader
Definition: AliFMDInput.h:419
TClonesArray * fArrayR
Definition: AliFMDInput.h:436
TTree * fTreeH
Definition: AliFMDInput.h:424
virtual Bool_t ProcessDigit(AliFMDDigit *digit)
Definition: AliFMDInput.h:456
AliFMDInput(const AliFMDInput &o)
Definition: AliFMDInput.h:332
virtual Bool_t ProcessUsers()
virtual Bool_t ProcessStack()
virtual Bool_t Init()
virtual Bool_t ProcessRawDigit(AliFMDDigit *digit)
Definition: AliFMDInput.h:458
virtual Bool_t ProcessRawCalibDigit(AliFMDDigit *digit)
Definition: AliFMDInput.h:459
virtual Bool_t ProcessRawCalibDigits()
virtual Int_t NEvents() const
Int_t fTreeMask
Definition: AliFMDInput.h:440
AliRun * fRun
Definition: AliFMDInput.h:415
virtual Bool_t ProcessESD(UShort_t d, Char_t r, UShort_t s, UShort_t t, Float_t eta, Float_t mult)
Definition: AliFMDInput.h:461
TTree * fTreeS
Definition: AliFMDInput.h:427
AliESDEvent * fESDEvent
Definition: AliFMDInput.h:422
virtual void RemoveLoad(ETrees tree)
Definition: AliFMDInput.h:137
TString fRawFile
Definition: AliFMDInput.h:441
static TArrayF MakeLogScale(Int_t n, Double_t min, Double_t max)
TClonesArray * fArrayA
Definition: AliFMDInput.h:437
TClonesArray * fArrayE
Definition: AliFMDInput.h:431
Bool_t fIsInit
Definition: AliFMDInput.h:443
virtual Bool_t ProcessDigits()
virtual Bool_t ProcessTrackRefs()
TTree * fTreeTR
Definition: AliFMDInput.h:425
virtual void AddLoad(ETrees tree)
Definition: AliFMDInput.h:134
virtual Bool_t ProcessSDigits()
static void ScanDirectory(TSystemDirectory *dir, const TString &olddir, TChain *chain, const char *pattern, bool recursive)
AliRawReader * fReader
Definition: AliFMDInput.h:418
TClonesArray * fArrayS
Definition: AliFMDInput.h:435
TString fGAliceFile
Definition: AliFMDInput.h:413
Event Summary Data for the Forward Multiplicity Detector.This stores the psuedo-multiplicity and -rap...
Definition: AliESDFMD.h:30
AliStack * fStack
Definition: AliFMDInput.h:416
TClonesArray * fArrayTR
Definition: AliFMDInput.h:433
AliFMD * fFMD
Definition: AliFMDInput.h:420
virtual Bool_t ProcessRecPoint(AliFMDRecPoint *point)
Definition: AliFMDInput.h:460
TClonesArray * fArrayD
Definition: AliFMDInput.h:434
Base class for reading in various FMD data. The class loops over all found events. For each event the specified data is read in. The class then loops over all elements of the read data, and process these with user defined code.
Definition: AliFMDInput.h:106
virtual Bool_t End()
virtual Bool_t ProcessESDs()
Int_t fNEvents
Definition: AliFMDInput.h:445
virtual Bool_t Run(UInt_t maxEvents=0)
AliESDFMD * fESD
Definition: AliFMDInput.h:421
class for summable digits
Definition: AliFMDSDigit.h:27
static TChain * MakeChain(const char *what, const char *datadir, bool recursive=false)
AliFMDhit is the hit class for the FMD. Hits are the information that comes from a Monte Carlo at eac...
Definition: AliFMDHit.h:30
virtual Bool_t ProcessRawDigits()
TTree * fTreeA
Definition: AliFMDInput.h:429
Int_t fEventCount
Definition: AliFMDInput.h:444
virtual Bool_t ProcessTrackRef(AliTrackReference *trackRef, TParticle *track)
Definition: AliFMDInput.h:451
virtual Bool_t ProcessParticle(Int_t i, TParticle *p)
Definition: AliFMDInput.h:455
virtual Bool_t ProcessUser(UShort_t d, Char_t r, UShort_t s, UShort_t t, Float_t v)
Definition: AliFMDInput.h:463
void SetRawFile(const char *file)
Definition: AliFMDInput.h:318
TClonesArray * fArrayH
Definition: AliFMDInput.h:432