From: ivana Date: Thu, 28 Jan 2010 11:39:19 +0000 (+0000) Subject: Time information in digitization: X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=9da52a4fd9fb9404ee454d97c26fe65eb606780f Time information in digitization: - In AliMUON, there is now the possibility of setting time limits in the age of a hit in order to be taken (or not) into account in the digitization process: SetTimeLimits(min, max) in Config file. - In AliMUONSDigitizerV2 the sDigits now contain the age of the original hit, shifted by the time of the triggered event. - In AliMUONDigitizarV3 only sdigits with age within the limits are used for digitization (Mercedes) --- diff --git a/MUON/AliMUON.cxx b/MUON/AliMUON.cxx index 31b0603106b..e8bcf527f13 100644 --- a/MUON/AliMUON.cxx +++ b/MUON/AliMUON.cxx @@ -102,7 +102,9 @@ AliMUON::AliMUON() fDigitMaker(0x0), fHitStore(0x0), fDigitStoreConcreteClassName(), - fCalibrationData(0x0) + fCalibrationData(0x0), + fTimeMin(-100000), + fTimeMax(100000) { /// Default Constructor @@ -137,7 +139,9 @@ AliMUON::AliMUON(const char *name, const char* title) fDigitMaker(new AliMUONDigitMaker), fHitStore(0x0), fDigitStoreConcreteClassName("AliMUONDigitStoreV2S"), - fCalibrationData() + fCalibrationData(), + fTimeMin(-100000), + fTimeMax(100000) { /// Standard constructor diff --git a/MUON/AliMUON.h b/MUON/AliMUON.h index ff28fa514c9..7fa012697e7 100644 --- a/MUON/AliMUON.h +++ b/MUON/AliMUON.h @@ -119,6 +119,15 @@ class AliMUON : public AliDetector /// Parametrised tail effect in resolution histogram virtual void SetTailEffect(Bool_t isTailEffect) { fIsTailEffect=isTailEffect; } + // For pileup studies + // + /// Set time limits for sdigits to be digitized + virtual void SetTimeLimits(Float_t time1, Float_t time2) {fTimeMin=time1; fTimeMax=time2;} + /// Return minimum time(*10^9) for a sdigit to be digitized + virtual Float_t GetTimeMin() {return fTimeMin;} + /// Return maximum time(*10^9) for a sdigit to be digitized + virtual Float_t GetTimeMax() {return fTimeMax;} + // Getters /// Return reference to Chamber \a id virtual AliMUONChamber& Chamber(Int_t id) @@ -169,6 +178,9 @@ class AliMUON : public AliDetector Int_t fDigitizerWithNoise; ///< Flag to switch on/off generation of noisy digits Bool_t fIsTailEffect; ///< Switch to turn on/off the tail effect + Float_t fTimeMin; // minimum time(*10^9) for an sdigit to be digitized + Float_t fTimeMax; // maximum time(*10^9) for an sdigit to be digitized + AliMUONRawWriter* fRawWriter; //!< Raw data writer AliMUONDigitMaker* fDigitMaker; //!< pointer to the digit maker class @@ -179,7 +191,7 @@ class AliMUON : public AliDetector AliMUONCalibrationData* fCalibrationData; ///< pointer of calibration data - ClassDef(AliMUON,17) // MUON Detector base class + ClassDef(AliMUON,18) // MUON Detector base class }; #endif diff --git a/MUON/AliMUONDigitizerV3.cxx b/MUON/AliMUONDigitizerV3.cxx index 3a20cf95e76..5c6f67eeb76 100644 --- a/MUON/AliMUONDigitizerV3.cxx +++ b/MUON/AliMUONDigitizerV3.cxx @@ -783,8 +783,14 @@ AliMUONDigitizerV3::MergeWithSDigits(AliMUONVDigitStore*& outputStore, TIter next(input.CreateIterator()); AliMUONVDigit* sdigit; + const float kTime1 = muon()->GetTimeMin(); + const float kTime2 = muon()->GetTimeMax(); + while ( ( sdigit = static_cast(next()) ) ) { + float time = sdigit->Time()*1E9; + if (timekTime2) continue; + // Update the track references using the mask. // FIXME: this is dirty, for backward compatibility only. // Should re-design all this way of keeping track of MC information... diff --git a/MUON/AliMUONSDigitizerV2.cxx b/MUON/AliMUONSDigitizerV2.cxx index 6d28bfd3137..f19d0fef45f 100644 --- a/MUON/AliMUONSDigitizerV2.cxx +++ b/MUON/AliMUONSDigitizerV2.cxx @@ -16,6 +16,7 @@ // $Id$ #include +#include #include "AliMUONSDigitizerV2.h" @@ -36,6 +37,7 @@ #include "AliLoader.h" #include "AliRun.h" #include "AliRunLoader.h" +#include "AliStack.h" //----------------------------------------------------------------------------- /// The sdigitizer performs the transformation from hits (energy deposits by @@ -131,6 +133,17 @@ AliMUONSDigitizerV2::Exec(Option_t*) 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; iparticleParticle(iparticle)->T(); + if (TMath::Abs(t)MakeSDigitsContainer(); TTree* treeS = loader->TreeS(); @@ -161,7 +174,7 @@ AliMUONSDigitizerV2::Exec(Option_t*) while ( ( hit = static_cast(next()) ) ) { Int_t chamberId = hit->Chamber()-1; - Float_t age = hit->Age(); + Float_t age = hit->Age()-T0; AliMUONChamber& chamber = muon->Chamber(chamberId); AliMUONResponse* response = chamber.ResponseModel();