]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Time information in digitization:
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Jan 2010 11:39:19 +0000 (11:39 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Jan 2010 11:39:19 +0000 (11:39 +0000)
- 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)

MUON/AliMUON.cxx
MUON/AliMUON.h
MUON/AliMUONDigitizerV3.cxx
MUON/AliMUONSDigitizerV2.cxx

index 31b0603106b38125076c3dd82e11eb2178d94e18..e8bcf527f13d41560aba5200f746f662d5e759c4 100644 (file)
@@ -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  
index ff28fa514c9516136a43bae2c7cb5c410b7e8426..7fa012697e79c7e4f074d5ca21ff580b4b044a05 100644 (file)
@@ -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
 
index 3a20cf95e76f7c8eff7c6e7dafc3b21c08ddd7f7..5c6f67eeb76809bfa3dcf7a1461519573204099f 100644 (file)
@@ -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<AliMUONVDigit*>(next()) ) )
   {
+    float time = sdigit->Time()*1E9;
+    if (time<kTime1 || time>kTime2) 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...
index 6d28bfd31379b161a7f52b205da8e0788720ad9f..f19d0fef45f2bee26fdeade93606d19fc9188fd7 100644 (file)
@@ -16,6 +16,7 @@
 // $Id$
 
 #include <TClonesArray.h>
+#include <TParticle.h>
 
 #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; iparticle<nparticles; ++iparticle) {
+      float t = stack->Particle(iparticle)->T();
+      if (TMath::Abs(t)<TMath::Abs(T0)) T0 = t;
+    }
+
     loader->MakeSDigitsContainer();
 
     TTree* treeS = loader->TreeS();
@@ -161,7 +174,7 @@ AliMUONSDigitizerV2::Exec(Option_t*)
       while ( ( hit = static_cast<AliMUONHit*>(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();