X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITS.h;h=5709f68d64e06e9764d17f3c86c6bd8963d47d3f;hb=c183cf7dc723b0f8deb75d2c0292acf8e18be2b3;hp=a6706585bdab5aeb167fc44b7ef33a7914163381;hpb=a8a6107b8ec2a0ac82487a82099095c32cffd002;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITS.h b/ITS/AliITS.h index a6706585bda..5709f68d64e 100644 --- a/ITS/AliITS.h +++ b/ITS/AliITS.h @@ -10,169 +10,211 @@ //////////////////////////////////////////////////////////////////////// #include // used in inline function GetModule. +#include // used in inline function SetHitsAddressBranch +#include "AliLoader.h" #include "AliDetector.h" -#include "AliITSsimulationSPD.h" -#include "AliITSsimulationSDD.h" -#include "AliITSsimulationSSD.h" +#include "AliITSDetType.h" class TString; class TTree; class TFile; -class AliITSDetType; +//class AliITSDetType; class AliITSsimulation; class AliITSClusterFinder; +class AliITSLoader; class AliITSsegmentation; class AliITSresponse; class AliITShit; class AliITSgeom; +class AliITSpListItem; class AliITSdigit; class AliITSRecPoint; class AliITSRawCluster; class AliITSmodule; -class AliITStrack; +class AliVertexer; const Int_t kNTYPES=3; - class AliITS : public AliDetector { - public: - AliITS(); - AliITS(const char *name, const char *title); - virtual ~AliITS(); - AliITS(AliITS &source); - AliITS & operator=(AliITS &source); - - virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits); - virtual void AddRealDigit(Int_t branch, Int_t *digits); - virtual void AddSimDigit(Int_t branch, AliITSdigit *d); - virtual void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,Int_t* tracks,Int_t *hits,Float_t* trkcharges); - // - virtual void AddCluster(Int_t branch, AliITSRawCluster *c); - virtual void AddRecPoint(const AliITSRecPoint &p); - - virtual void ResetDigits(); // depending on how the - virtual void ResetDigits(Int_t branch); // tree will be filled only - virtual void ResetClusters(); // one of the methods in - virtual void ResetClusters(Int_t branch); // the pair will be kept - virtual void ResetRecPoints(); - + public: + //================= Standard Classes =============================== + AliITS(); // Default creator. + AliITS(const char *name, const char *title); // standard Creator + virtual ~AliITS(); // destructor + AliITS(const AliITS &source); // copy constructor. Not to be used! + AliITS& operator=(AliITS &source); // = operator. Not to be used! + virtual Int_t IsVersion() const {return 1;} + virtual Int_t DistancetoPrimitive(Int_t px, Int_t py) const; + + //===================== Simulation Geometry ======================== // get geometry version - detailed (major) or coarse (minor) - void GetGeometryVersion(Int_t &a,Int_t &b) const - {a = fMajorVersion;b=fMinorVersion;return;} - virtual Int_t IsVersion() const {return 1;} - virtual Int_t DistancetoPrimitive(Int_t px, Int_t py); - virtual void Init(); - virtual void SetDefaults(); - virtual void SetDefaultSimulation(); - virtual void SetDefaultClusterFinders(); - // create separate tree for clusters - declustering refining - virtual void MakeTreeC(Option_t *option="C"); - void GetTreeC(Int_t event); - virtual void MakeBranch(Option_t *opt=" ", char *file=0); - void SetTreeAddress(); - virtual void SetEUCLID(Bool_t euclid=1) {fEuclidOut = euclid;} - virtual void StepManager() {} - // sort hits by module - virtual void InitModules(Int_t size,Int_t &nmodules); - virtual void FillModules(Int_t evnt,Int_t bgrev, - Int_t nmodules,Option_t *opt,Text_t *filename); - virtual void ClearModules(); - // Digitisation - virtual void SDigits2Digits(); - void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size, - Option_t *add, Option_t *det, Text_t *filename); - // Reconstruct hits - void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det); - // Fast simulation of space points from hits - void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size, - Option_t *add, Option_t *det, Text_t *filename); - - // Write digits into raw data format - virtual void Digits2RawData() {} - // Decode raw data and store digits - virtual void RawData2Digits() {} + virtual Int_t GetMajorVersion() const {return -1;} + virtual Int_t GetMinorVersion() const {return -1;} + virtual void GetGeometryVersion(Int_t &a,Int_t &b) + {a = GetMajorVersion();b=GetMinorVersion();return;} + virtual void SetEUCLID(Bool_t euclid=kTRUE) {fEuclidOut = euclid;} + //-------------------- Geometry Transformations -------------------- + // ITS geometry functions + AliITSgeom *GetITSgeom() const {return fITSgeom;} + // Sets ITS geometry ! be very careful using this function. + void SetITSgeom(AliITSgeom *geom) {fITSgeom = geom;} + // return pointer to the array of modules + TObjArray *GetModules() const {return fITSmodules;} + // return pointer to a particular module + AliITSmodule *GetModule(Int_t index) {return (AliITSmodule *) + (fITSmodules->At(index));} - // Configuration Methods (per detector type ) + //================ Necessary general Classes ======================= + virtual void Init(); + virtual AliLoader* MakeLoader(const char* topfoldername); + virtual void SetDefaults(); + virtual void SetDefaultSimulation(); + virtual void SetDefaultClusterFinders(); + virtual void MakeBranch(Option_t *opt=" "); + virtual void SetTreeAddress(); + // For a given branch from the treeH sets the TClonesArray address. + virtual void SetHitsAddressBranch(TBranch *b) {b->SetAddress(&fHits);} + // Return pointer to DetType #id + AliITSDetType *DetType(Int_t id); + //Int_t NDetTypes() {return fNDetTypes;} + //---------- Configuration Methods (per detector type) ------------- + // Determines which ITS subdetectors will be processed. Effects + // digitization, and Reconstruction only. + void SetDetectors(Option_t *opt="All"){fOpt = opt;} + // Returns the list of ITS subdetectors that will be processed. + Option_t* GetDetectors(){return fOpt;} // Set response - virtual void SetResponseModel(Int_t id, AliITSresponse *response); + virtual void SetResponseModel(Int_t id, AliITSresponse *response); // Set segmentation - virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg); + virtual void SetSegmentationModel(Int_t id, AliITSsegmentation *seg); // Set simulation - temporary - virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim); + virtual void SetSimulationModel(Int_t id, AliITSsimulation *sim); + // Set simulation - temporary + virtual AliITSsimulation* GetSimulationModel(Int_t id){ + return ((AliITSDetType*)(fDetTypes->At(id)))->GetSimulationModel();} // Set reconstruction - virtual void SetReconstructionModel(Int_t id, AliITSClusterFinder *rec); + virtual void SetReconstructionModel(Int_t id, AliITSClusterFinder *rec); // Set class names for digit and rec point - virtual void SetClasses(Int_t id, const char *digit, const char *cluster); - + virtual void SetClasses(Int_t id, const char *digit, const char *cluster); + + //=================== Hits ========================================= + virtual void StepManager() {} // See Step Manager for specific geometry. + virtual void AddHit(Int_t track, Int_t *vol, Float_t *hits); + //------------ sort hits by module for Digitisation ---------------- + virtual void InitModules(Int_t size,Int_t &nmodules); + virtual void FillModules(TTree *treeH, Int_t mask = 0); + virtual void FillModules(Int_t evnt,Int_t bgrev,Int_t nmodules, + Option_t *opt, const char *filename); + virtual void ClearModules(); + + //===================== Digitisation =============================== + void MakeBranchS(const char *file); + void SetTreeAddressS(TTree *treeS); + TClonesArray * GetSDigits() { return fSDigits; } + void MakeBranchInTreeD(TTree *treeD,const char *file=0); + void MakeBranchD(const char *file){ + MakeBranchInTreeD(GetLoader()->TreeD(),file);} + void SetTreeAddressD(TTree *treeD); + void Hits2SDigits(); // Turn hits into SDigits + void Hits2PreDigits(); // Turn hits into SDigits + AliDigitizer* CreateDigitizer(AliRunDigitizer* manager) const; + void SDigits2Digits(){SDigitsToDigits("All");} // Turn SDigits to Digits + void SDigitsToDigits(Option_t *opt="All"); // Turn SDigits to Digits + void Hits2Digits(); // Turn hits straight into Digits. + //------------------ Internal functions ---------------------------- + // Standard Hits To SDigits function + void HitsToSDigits(Int_t evNumber,Int_t bgrev,Int_t size, + Option_t *add, Option_t *det, const char *filename); + // Standard Hits To SDigits function + void HitsToPreDigits(Int_t evNumber,Int_t bgrev,Int_t size, + Option_t *add, Option_t *det, const char *filename); + // Standard Hits To Digits function + void HitsToDigits(Int_t evNumber,Int_t bgrev,Int_t size, + Option_t *add, Option_t *det, const char *filename); + void ResetSDigits(); // Resets the Summable digits. + void ResetDigits(); // depending on how the + void ResetDigits(Int_t branch); // tree will be filled only + void AddSumDigit(AliITSpListItem &sdig); + void AddRealDigit(Int_t branch, Int_t *digits); + void AddSimDigit(Int_t branch, AliITSdigit *d); + void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits, + Int_t* tracks,Int_t *hits,Float_t* trkcharges); + // Return pointers to digits + TObjArray *Dtype() {return fDtype;} + Int_t *Ndtype() {return fNdtype;} + TClonesArray *DigitsAddress(Int_t id) + {return ((TClonesArray *) (*fDtype)[id]);} + void SelectVertexer(TString sel=" "){fSelectedVertexer = sel;} - // Getters - // ITS geometry functions - virtual AliITSgeom *GetITSgeom() const {return fITSgeom;} - // return pointer to the array of modules - virtual TObjArray *GetModules() const {return fITSmodules;} - // return pointer to a particular module - AliITSmodule *GetModule(Int_t index) {return (AliITSmodule *) - (fITSmodules->At(index));} + //===================== Raw Data IO ================================ + // Write digits into raw data format + virtual void Digits2RawData() {} + // Decode raw data and store digits + virtual void RawData2Digits() {} - // Return pointers to digits - TObjArray *Dtype() {return fDtype;} - Int_t *Ndtype() {return fNdtype;} - virtual TClonesArray *DigitsAddress(Int_t id) - {return ((TClonesArray *) (*fDtype)[id]);} + //==================== Clusterization ============================== + // create separate tree for clusters - declustering refining + void MakeTreeC(Option_t *option="C"); + void GetTreeC(Int_t event); + void AddCluster(Int_t branch, AliITSRawCluster *c); + void ResetClusters(); // one of the methods in + void ResetClusters(Int_t branch); // the pair will be kept // Return pointers to clusters - TObjArray *Ctype() {return fCtype;} - Int_t *Nctype() {return fNctype;} - virtual TClonesArray *ClustersAddress(Int_t id) + TObjArray *Ctype() {return fCtype;} + Int_t *Nctype() {return fNctype;} + TClonesArray *ClustersAddress(Int_t id) {return ((TClonesArray *) (*fCtype)[id]);} + //=================== Reconstruction =============================== + void MakeBranchR(const char *file, Option_t *opt=" "); + void MakeBranchRF(const char *file){MakeBranchR(file,"Fast");} + void MakeBranchC(); + void SetTreeAddressR(TTree *treeR); + void AddRecPoint(const AliITSRecPoint &p); + void HitsToFastRecPoints(Int_t evNumber,Int_t bgrev,Int_t size, + Option_t *add, Option_t *det, const char *filename); + void Digits2Reco(); + void DigitsToRecPoints(Int_t evNumber,Int_t lastEntry,Option_t *det); + void ResetRecPoints(); // Return pointer to rec points TClonesArray *RecPoints() {return fRecPoints;} - // Return pointer to DetType #id - AliITSDetType *DetType(Int_t id); - //Int_t NDetTypes() {return fNDetTypes;} + virtual void Reconstruct() const; + virtual AliTracker* CreateTracker() const; + virtual AliVertexer* CreateVertexer() const; + virtual void FillESD(AliESD* esd) const; + + protected: + //================== Data Members ================================== + AliITSgeom *fITSgeom; // Pointer to ITS geometry + Bool_t fEuclidOut; // Flag to write geometry in euclid format + TObjArray *fITSmodules; //! Pointer to ITS modules + Option_t *fOpt; //! Detector option ="All" unless changed. - // Return pointer to the tree of clusters - TTree *TreeC() {return fTreeC;} + Int_t fIdN; // the number of layers + Int_t *fIdSens; //[fIdN] layer identifier + TString *fIdName; //[fIdN] layer identifier + Int_t fNDetTypes; // Number of detector types + TObjArray *fDetTypes; // List of detector types - // tracking + TClonesArray *fSDigits; //! List of Summable digits. + Int_t fNSDigits; // Number of Summable Digits. - AliITStrack Tracking(AliITStrack &track, AliITStrack *reference, TObjArray *fpoints, Int_t **vettid, - Bool_t flagvert ); + TObjArray *fDtype; //! List of digits + Int_t *fNdtype; //[fNDetTypes] Num. of digits per type of det. - void DoTracking(Int_t evNumber, Int_t min_t, Int_t max_t, TFile *file, Bool_t flagvert); + TObjArray *fCtype; //! List of clusters + Int_t *fNctype; //[fNDetTypes] Num. of clust. per type of det. - protected: + TClonesArray *fRecPoints; //! List of reconstructed points + Int_t fNRecPoints; // Number of rec points + TString fSelectedVertexer; // Vertexer selected in CreateVertexer - AliITSgeom *fITSgeom; // Pointer to ITS geometry - TObjArray *fITSmodules; // Pointer to ITS modules - Bool_t fEuclidOut; // Flag to write geometry in euclid format - Int_t fIdN; // the number of layers - Int_t *fIdSens; //[fIdN] layer identifier -// TObjArray *fIdName; // array of volume Id names - TString *fIdName; //[fIdN] layer identifier - // Geometry and Stepmanager version numbers used. - Int_t fMajorVersion; // detailed and coarse(minor) versions - Int_t fMinorVersion; // detailed and coarse(minor) versions - // - Int_t fNDetTypes; // Number of detector types - TObjArray *fDetTypes; // List of detector types - - TObjArray *fDtype; // List of digits - Int_t *fNdtype; //[fNDetTypes] Num. of digits per type of det. - TObjArray *fCtype; // List of clusters - Int_t *fNctype; //[fNDetTypes] Num. of clust. per type of det. - - TClonesArray *fRecPoints; // List of reconstructed points - Int_t fNRecPoints; // Number of rec points - TTree *fTreeC; // Tree for raw clusters - - - ClassDef(AliITS,1) // Base class for ITS + ClassDef(AliITS,4) // Base class for ITS }; #endif