18 #include <TClonesArray.h>
19 #include <TParticle.h>
37 #include "AliCDBManager.h"
38 #include "AliLoader.h"
40 #include "AliRunLoader.h"
42 #include "AliHeader.h"
43 #include "AliGenCocktailEventHeader.h"
78 AliFatal(
"Could not access mapping from OCDB !");
105 AliRunLoader* runLoader = AliRunLoader::Instance();
106 AliLoader* loader = runLoader->GetDetectorLoader(
"MUON");
108 loader->LoadHits(
"READ");
112 Int_t nofEvents(runLoader->GetNumberOfEvents());
120 AliFatal(Form(
"Could not create digitstore of class %s",classname.Data()));
123 AliDebug(1,Form(
"Will use digitStore of type %s",sDigitStore->ClassName()));
127 for ( Int_t iEvent = 0; iEvent < nofEvents; ++iEvent )
131 tdlist.SetOwner(kTRUE);
133 AliDebug(1,Form(
"iEvent=%d",iEvent));
134 runLoader->GetEvent(iEvent);
138 AliHeader* header = runLoader->GetHeader();
139 AliGenCocktailEventHeader* cocktailHeader =
140 dynamic_cast<AliGenCocktailEventHeader*
>(header->GenEventHeader());
141 if (cocktailHeader) {
142 AliGenCocktailEventHeader* genEventHeader = (AliGenCocktailEventHeader*) (header->GenEventHeader());
143 TList* headers = genEventHeader->GetHeaders();
144 TIter nextH(headers);
145 AliGenEventHeader *entry;
146 while((entry = (AliGenEventHeader*)nextH())) {
147 float t = entry->InteractionTime();
148 if (TMath::Abs(t)<TMath::Abs(t0)) t0 = t;
152 AliGenEventHeader* evtHeader =
153 (AliGenEventHeader*)(header->GenEventHeader());
156 float t = evtHeader->InteractionTime();
157 if (TMath::Abs(t)<TMath::Abs(t0)) t0 = t;
168 loader->MakeSDigitsContainer();
170 TTree* treeS = loader->TreeS();
179 TTree* treeH = loader->TreeH();
184 Long64_t nofTracks = treeH->GetEntries();
186 for ( Long64_t iTrack = 0; iTrack < nofTracks; ++iTrack )
189 treeH->GetEvent(iTrack);
195 while ( ( hit = static_cast<AliMUONHit*>(next()) ) )
197 Int_t chamberId = hit->
Chamber()-1;
198 Float_t age = hit->
Age()-t0;
207 Float_t timeDif=age-chamberTime;
222 TIter nextd(&digits);
241 while ( ( d = static_cast<AliMUONVDigit*>(next()) ) )
248 AliError(
"Could not add digit to digitStore");
254 loader->WriteSDigits(
"OVERWRITE");
256 sDigitStore->
Clear();
258 loader->UnloadSDigits();
264 loader->UnloadHits();
const TString DigitStoreClassName() const
Return digit store class name.
Interface for a digit container.
Virtual store to hold digit.
MUON tracking chamber class.
for(Int_t isec=54;isec< 71;isec+=1)
virtual void ChargeInFC(Bool_t value=kTRUE)=0
Set the unit value (see note 1 in AliMUONVDigit.cxx)
Float_t Age() const
Return Particle Age.
virtual AliMUONChamber & Chamber(Int_t id)
Return reference to Chamber id.
AliDetector class for MUON subsystem providing simulation data management.
static Float_t fgkMaxIntTime
maximum time of interaction
virtual void AddTrack(Int_t, Float_t)
Add a track (and its charge) to the list of tracks we handle.
virtual Float_t Charge() const =0
The charge of this digit, calibrated or not depending on IsCalibrated()
MUON SDigitizer (from Hits to SDigits).
static Float_t fgkMaxPosTimeDif
maximum event time after the triggered event for a hit to be digitized
static Float_t fgkMaxNegTimeDif
maximum event time before the triggered event for a hit to be digitized
virtual AliMUONVDigitStore * Create() const =0
Create an (empty) object of the same concrete class as *this.
virtual AliMUONVStore * Create() const =0
Create an empty copy of this.
static Float_t fgkMinTimeDif
minimum time difference for the reduction factor to be applied
virtual void SetTime(Float_t)
Set hit age.
virtual AliMUONResponse *& ResponseModel()
Get pointer to response model.
static Float_t AverageChamberT(Int_t i)
Return average arrival time to chamber i.
virtual void Digitize(Option_t *opt="")
virtual ~AliMUONSDigitizerV2()
Chamber response base class.
virtual TIterator * CreateIterator() const =0
Return an iterator to loop over hits.
virtual void Clear(Option_t *opt="")=0
Clear ourselves (i.e. Reset)
virtual void DisIntegrate(const AliMUONHit &hit, TList &digits, Float_t timeDif)
virtual Bool_t Connect(TTree &tree, Bool_t alone=kTRUE) const
Connect us to a TTree (only valid if CanConnect()==kTRUE)
static Bool_t LoadMpSegmentation(Bool_t warn=false)
virtual Bool_t Add(TObject *object)
Add an object, if it is of the right class.
virtual void SetHit(Int_t)
Set the hit number.