Simple example macro to make some analyzis for the ESD tracks - see comments (Not...
[u/mrichter/AliRoot.git] / ITS / AliITSDetTypeSim.h
CommitLineData
3b9df642 1#ifndef ALIITSDETTYPESIM_H
2#define ALIITSDETTYPESIM_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/*
7$Id$
8*/
9
7d62fb64 10/////////////////////////////////////////////////////////////////////////
11// * This class contains all of the "external" information needed to do//
12// * detector specific simulations for the ITS. //
13/////////////////////////////////////////////////////////////////////////
14
3b9df642 15#include <TObject.h>
16#include <TObjArray.h>
17#include <TClonesArray.h>
fe20e72f 18#include "AliITSCalibration.h"
19#include "AliITSgeom.h"
3b9df642 20
8ba39da9 21class TTree;
22class AliCDBMetaData;
7d62fb64 23class AliITSdigit;
24class AliITSmodule;
25class AliITSpListItem;
3b9df642 26class AliITSsimulation;
27class AliITSsegmentation;
681e8104 28class AliITSresponse;
7d62fb64 29class AliLoader;
3b9df642 30
31class AliITSDetTypeSim : public TObject {
7d62fb64 32 public:
33
34 AliITSDetTypeSim();
35 virtual ~AliITSDetTypeSim();
36 AliITSDetTypeSim(const AliITSDetTypeSim &source);
37 AliITSDetTypeSim& operator=(const AliITSDetTypeSim &source);
38 AliITSgeom *GetITSgeom() const {return fGeom;}
3b9df642 39 void SetITSgeom(AliITSgeom *geom){fGeom=geom;}
7d62fb64 40
41 virtual void SetSimulationModel(Int_t dettype,AliITSsimulation *sim);
42 virtual AliITSsimulation* GetSimulationModel(Int_t dettype);
43 virtual AliITSsimulation* GetSimulationModelByModule(Int_t module);
44
45 virtual void SetSegmentationModel(Int_t dettype,AliITSsegmentation *seg);
46 virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype);
47 virtual AliITSsegmentation* GetSegmentationModelByModule(Int_t module);
48
fcf95fc7 49 virtual void SetCalibrationModel(Int_t iMod,AliITSCalibration *resp);
50 virtual AliITSCalibration* GetCalibrationModel(Int_t iMod);
681e8104 51 virtual AliITSresponse* GetResponse(Int_t dettype) {return GetCalibrationModel(GetITSgeom()->GetStartDet(dettype))->GetResponse();}
7d62fb64 52
fcf95fc7 53 TObjArray* GetCalibrationArray() const {return fCalibration;}
7d62fb64 54 TObjArray* GetSegmentation() const {return fSegmentation;}
fcf95fc7 55 void ResetCalibrationArray();
7d62fb64 56 void ResetSegmentation();
57
58 virtual void SetLoader(AliLoader* loader) {fLoader=loader;}
59 AliLoader* GetLoader() const {return fLoader;}
60
61 virtual void SetDefaults();
62 virtual void SetDefaultSimulation();
8ba39da9 63 virtual void SetRunNumber(Int_t rn=0){fRunNumber = rn;}
64 virtual Int_t GetRunNumber() const {return fRunNumber;}
7d62fb64 65 virtual void SetTreeAddressS(TTree* treeS, Char_t* name);
66 virtual void SetTreeAddressD(TTree* treeD, Char_t* name);
67
68 virtual void SetSDigits(TClonesArray* sdigits) {fSDigits=sdigits;}
69 virtual void SetDigits(TObjArray* digits) {fDigits=digits;}
70 TClonesArray* GetSDigits() const {return fSDigits;}
71 TObjArray* GetDigits() const {return fDigits;}
72 Int_t* GetNDigitArray() const {return fNDigits;}
73 TClonesArray *DigitsAddress(Int_t id) const { return ((TClonesArray*)(*fDigits)[id]);}
3b9df642 74
3b9df642 75 virtual void ResetSDigits(){fNSDigits=0;if(fSDigits!=0) fSDigits->Clear();}
7d62fb64 76 virtual void ResetDigits();
77 virtual void ResetDigits(Int_t branch);
78 virtual void SDigitsToDigits(Option_t *opt,Char_t* name);
79
80 virtual void AddSumDigit(AliITSpListItem &sdig);
81 virtual void AddRealDigit(Int_t branch, Int_t *digits);
8ba39da9 82 virtual void AddSimDigit(Int_t branch, AliITSdigit *d);
83 virtual void AddSimDigit(Int_t branch,Float_t phys,Int_t* digits,
84 Int_t* tracks,Int_t *hits,Float_t* trkcharges);
7d62fb64 85
86 virtual void SetDigitClassName(Int_t i, Char_t* name) {fDigClassName[i]=name;}
87 Char_t* GetDigitClassName(Int_t i) const {return fDigClassName[i];}
8ba39da9 88
89 void StoreCalibration(Int_t firstRun, Int_t lastRun, AliCDBMetaData &md);
90
91 protected:
92
fcf95fc7 93 virtual void CreateCalibrationArray();
8ba39da9 94 virtual Bool_t GetCalibration();
7d62fb64 95
96 private:
8ba39da9 97
1964ae5f 98 void SetDefaultSegmentation(Int_t idet); // creates def segm.
8ba39da9 99 static const Int_t fgkNdettypes; // number of different det. types
100 static const Int_t fgkDefaultNModulesSPD; // Total numbers of SPD modules by default
101 static const Int_t fgkDefaultNModulesSDD; // Total numbers of SDD modules by default
102 static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules by default
103 Int_t fNMod[3]; // numbers of modules from different types
104
7d62fb64 105 AliITSgeom *fGeom; // pointer to ITS geom
106 TObjArray *fSimulation; //! [NDet]
107 TObjArray *fSegmentation; //! [NDet]
fcf95fc7 108 TObjArray *fCalibration; //! [NMod]
7d62fb64 109 TObjArray *fPreProcess; //! [] e.g. Fill fHitModule with hits
110 TObjArray *fPostProcess; //! [] e.g. Wright Raw data
3b9df642 111 Int_t fNSDigits; //! number of SDigits
112 TClonesArray *fSDigits; //! [NMod][NSDigits]
7d62fb64 113 Int_t* fNDigits; //! [NDet] number of Digits for det.
b17dae48 114 Int_t fRunNumber; //! run number (to access DB)
7d62fb64 115 TObjArray *fDigits; //! [NMod][NDigits]
116 TString fHitClassName; //! String with Hit class name
117 TString fSDigClassName;//! String with SDigit class name.
118 Char_t* fDigClassName[3]; //! String with digit class name.
b17dae48 119 AliLoader* fLoader; //! loader
120 Bool_t fFirstcall; //! flag
7d62fb64 121
b17dae48 122 ClassDef(AliITSDetTypeSim,4) // ITS Simulation structure
7d62fb64 123
124};
3b9df642 125
3b9df642 126#endif