]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONResponseV0.cxx
code cleanup: renaming functions; adding prototype code for later development; no...
[u/mrichter/AliRoot.git] / MUON / AliMUONResponseV0.cxx
index 65b9ad5ef22b144483ff2c22addfbd2d187c172f..5bc82aea728017280d5d068f973aa26f4de1f086 100644 (file)
@@ -45,6 +45,8 @@
 #include <TMath.h>
 #include <TRandom.h>
 
+using std::endl;
+using std::cout;
 /// \cond CLASSIMP
 ClassImp(AliMUONResponseV0)
 /// \endcond
@@ -271,6 +273,9 @@ AliMUONResponseV0::DisIntegrate(const AliMUONHit& hit, TList& digits, Float_t ti
     qtot = AliMUONConstants::ReducedQTot(qtot,timeDif);
   }
   
+  // Scale the charge to it'll (roughly) be in fC
+  qtot *= AliMUONConstants::DefaultADC2MV()*AliMUONConstants::DefaultA0()*AliMUONConstants::DefaultCapa();
+  
   // Get the charge correlation between cathodes.
   Float_t currentCorrel = TMath::Exp(gRandom->Gaus(0.0,ChargeCorrel()/2.0));
 
@@ -328,16 +333,19 @@ AliMUONResponseV0::DisIntegrate(const AliMUONHit& hit, TList& digits, Float_t ti
       Float_t qp = TMath::Abs(fMathieson->IntXY(lowerLeft.X(),lowerLeft.Y(),
                                                 upperRight.X(),upperRight.Y()));
             
-      Int_t icharge = Int_t(qp*qcath);
-      
-      if ( qp > fChargeThreshold )
+      if ( qp > fChargeThreshold && 
+           qp*qcath > AliMUONConstants::DefaultADC2MV()*AliMUONConstants::DefaultA0()*AliMUONConstants::DefaultCapa() )
       {
         // If we're above threshold, then we create a digit,
         // and fill it with relevant information, including electronics.
+        
+        // note that the second condition above is to be backward compatible (when 
+        // the sdigitizer was making a cut on Int_t(qp*qcath) > 0 and qcath was in ADC, not in fC)
+        
         AliMUONDigit* d = new AliMUONDigit(detElemId,pad.GetManuId(),
                                            pad.GetManuChannel(),cath);
         d->SetPadXY(pad.GetIx(),pad.GetIy());
-        d->SetCharge(icharge);
+        d->SetCharge(qp*qcath);
         digits.Add(d);   
       }       
       it->Next();