// $Id$
#include <TClonesArray.h>
+#include <TParticle.h>
#include "AliMUONSDigitizerV2.h"
-#include "AliLog.h"
#include "AliMUON.h"
#include "AliMUONChamber.h"
#include "AliMUONVDigit.h"
#include "AliMUONHit.h"
-#include "AliMpDEManager.h"
-#include "AliMpCDB.h"
-#include "AliLoader.h"
-#include "AliRun.h"
-#include "AliRunLoader.h"
#include "AliMUONVDigitStore.h"
#include "AliMUONVHitStore.h"
-
-#include "AliCDBManager.h"
#include "AliMUONCalibrationData.h"
#include "AliMUONResponseTrigger.h"
+#include "AliMpCDB.h"
+#include "AliMpDEManager.h"
+
+#include "AliLog.h"
+#include "AliCDBManager.h"
+#include "AliLoader.h"
+#include "AliRun.h"
+#include "AliRunLoader.h"
+#include "AliStack.h"
+
//-----------------------------------------------------------------------------
/// The sdigitizer performs the transformation from hits (energy deposits by
/// the transport code) to sdigits (equivalent of charges on pad).
///
/// ctor.
///
- if ( ! AliMpCDB::LoadMpSegmentation() )
- {
+
+ // Load mapping
+ if ( ! AliMpCDB::LoadMpSegmentation() ) {
AliFatal("Could not access mapping from OCDB !");
}
}
AliDebug(1,"");
- AliRunLoader* runLoader = AliRunLoader::GetRunLoader();
+ AliRunLoader* runLoader = AliRunLoader::Instance();
AliLoader* loader = runLoader->GetDetectorLoader("MUON");
loader->LoadHits("READ");
AliFatal(Form("Could not create digitstore of class %s",classname.Data()));
}
- AliInfo(Form("Will use digitStore of type %s",sDigitStore->ClassName()));
+ AliDebug(1,Form("Will use digitStore of type %s",sDigitStore->ClassName()));
for ( Int_t iEvent = 0; iEvent < nofEvents; ++iEvent )
{
AliDebug(1,Form("iEvent=%d",iEvent));
runLoader->GetEvent(iEvent);
+ // for pile up studies
+ runLoader->LoadKinematics();
+ AliStack* stack = runLoader->Stack();
+ Int_t nparticles = (Int_t) stack->GetNtrack();
+ float T0=10; // time of the triggered event
+ // loop to find the time of the triggered event (this may change)
+ for (Int_t iparticle=0; iparticle<nparticles; ++iparticle) {
+ float t = stack->Particle(iparticle)->T();
+ if (TMath::Abs(t)<TMath::Abs(T0)) T0 = t;
+ }
+
loader->MakeSDigitsContainer();
TTree* treeS = loader->TreeS();
while ( ( hit = static_cast<AliMUONHit*>(next()) ) )
{
Int_t chamberId = hit->Chamber()-1;
+ Float_t age = hit->Age()-T0;
+
AliMUONChamber& chamber = muon->Chamber(chamberId);
AliMUONResponse* response = chamber.ResponseModel();
TList digits;
response->DisIntegrate(*hit,digits);
- TIter next(&digits);
+ TIter nextd(&digits);
AliMUONVDigit* d;
- while ( ( d = (AliMUONVDigit*)next() ) )
+ while ( ( d = (AliMUONVDigit*)nextd() ) )
{
// Update some sdigit information that could not be known
// by the DisIntegrate method
d->SetHit(ihit);
- d->AddTrack(iTrack,d->Charge());
+ d->SetTime(age);
+ d->AddTrack(hit->GetTrack(),d->Charge());
tdlist.Add(d);
}
++ihit;