AliMUONSDigitizerV2::AliMUONSDigitizerV2()
: TTask("AliMUONSDigitizerV2","From Hits to SDigits for MUON")
{
+ //
+ // ctor.
+ //
}
//_____________________________________________________________________________
AliMUONSDigitizerV2::~AliMUONSDigitizerV2()
{
+ //
+ // dtor.
+ //
}
//_____________________________________________________________________________
//
// Go from hits to sdigits.
//
+ // In the code below, apart from the loop itself (which look complicated
+ // but is really only a loop on each hit in the input file) the main
+ // work is done in AliMUONResponse::DisIntegrate method, which converts
+ // a single hit in (possibly) several sdigits.
+ //
AliDebug(1,"");
const Int_t nofEvents(runLoader->GetNumberOfEvents());
for ( Int_t iEvent = 0; iEvent < nofEvents; ++iEvent )
{
+ // Loop over events.
TObjArray tdlist;
tdlist.SetOwner(kTRUE);
Long64_t nofTracks = treeH->GetEntries();
for ( Long64_t iTrack = 0; iTrack < nofTracks; ++iTrack )
{
+ // Loop over the tracks of this event.
treeH->GetEvent(iTrack);
TClonesArray* hits = muonData.Hits();
Int_t nofHits = hits->GetEntriesFast();
for ( Int_t ihit = 0; ihit < nofHits; ++ihit )
{
+ // Loop over the hits of this track.
AliMUONHit* hit = static_cast<AliMUONHit*>(hits->At(ihit));
Int_t chamberId = hit->Chamber()-1;
AliMUONChamber& chamber = muon->Chamber(chamberId);
AliMUONResponse* response = chamber.ResponseModel();
- TList digits;
+
+ // This is the heart of this method : the dis-integration
+ TList digits;
response->DisIntegrate(*hit,digits);
+
TIter next(&digits);
AliMUONDigit* d;
while ( ( d = (AliMUONDigit*)next() ) )
{
+ // Update some sdigit information that could not be known
+ // by the DisIntegrate method
d->SetHit(ihit);
+ d->AddTrack(iTrack,d->Signal());
tdlist.Add(d);
}
}
muonData.ResetHits();
- } // loop on tracks within an event
- tdlist.Sort(); // not really needed, except for comparing with old sdigitizer
+ } // end of loop on tracks within an event
+
for ( Int_t i = 0; i <= tdlist.GetLast(); ++i )
{
AliMUONDigit* d = (AliMUONDigit*)tdlist[i];
}
muonData.Fill("S");
fLoader->WriteSDigits("OVERWRITE");
+
muonData.ResetSDigits();
fLoader->UnloadSDigits();
} // loop on events
/// \ingroup sim
/// \class AliMUONSDigitizerV2
-/// \brief New sdigitizer, not deriving from MUONDigitizer, and using
-/// new Response:DisIntegrate method
+/// \brief MUON SDigitizer (from Hits to SDigits).
///
+/// New sdigitizer, not deriving from MUONDigitizer, and using
+/// new Response:DisIntegrate method
/// Note also that this one does *not* merge sdigits at all
/// (this is deferred to the digitizer, which anyway has to do it),
/// thus speeding a little bit this step.
virtual void Exec(Option_t* opt="");
- ClassDef(AliMUONSDigitizerV2,1) //
+ ClassDef(AliMUONSDigitizerV2,1) // MUON SDigitizer V2-1
};
#endif