]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
First half of changes for displaced vertices - second half to follow
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Mar 2012 13:04:10 +0000 (13:04 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 5 Mar 2012 13:04:10 +0000 (13:04 +0000)
PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.cxx
PWGLF/FORWARD/analysis2/AliFMDDensityCalculator.h
PWGLF/FORWARD/analysis2/AliFMDSharingFilter.cxx
PWGLF/FORWARD/analysis2/AliFMDSharingFilter.h
PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx
PWGLF/FORWARD/analysis2/AliForwardMultiplicityTask.cxx
PWGLF/FORWARD/analysis2/AliForwardQATask.cxx
PWGLF/FORWARD/analysis2/AliForwardUtil.cxx
PWGLF/FORWARD/analysis2/AliForwardUtil.h

index c61827032a869456e2de19c44cf695f80a73a433..10f85016db98fff8d48880e974819f33e13f92a8 100644 (file)
@@ -45,7 +45,8 @@ AliFMDDensityCalculator::AliFMDDensityCalculator()
     fEtaLumping(32), 
     fPhiLumping(4),    
     fDebug(0),
-    fCuts()
+    fCuts(),
+    fRecalculateEta(false)
 {
   // 
   // Constructor 
@@ -75,7 +76,8 @@ AliFMDDensityCalculator::AliFMDDensityCalculator(const char* title)
     fEtaLumping(32), 
     fPhiLumping(4),
     fDebug(0),
-    fCuts()
+    fCuts(),
+    fRecalculateEta(false)
 {
   // 
   // Constructor 
@@ -140,7 +142,8 @@ AliFMDDensityCalculator::AliFMDDensityCalculator(const
     fEtaLumping(o.fEtaLumping), 
     fPhiLumping(o.fPhiLumping),
     fDebug(o.fDebug),
-    fCuts(o.fCuts)
+    fCuts(o.fCuts),
+    fRecalculateEta(o.fRecalculateEta)
 {
   // 
   // Copy constructor 
@@ -194,6 +197,7 @@ AliFMDDensityCalculator::operator=(const AliFMDDensityCalculator& o)
   fEtaLumping         = o.fEtaLumping;
   fPhiLumping         = o.fPhiLumping;
   fCuts               = o.fCuts;
+  fRecalculateEta     = o.fRecalculateEta;
 
   fRingHistos.Delete();
   TIter    next(&o.fRingHistos);
@@ -288,7 +292,8 @@ AliFMDDensityCalculator::Calculate(const AliESDFMD&        fmd,
                                   AliForwardUtil::Histos& hists,
                                   UShort_t                vtxbin, 
                                   Bool_t                  lowFlux,
-                                  Double_t                /* cent */)
+                                  Double_t                cent, 
+                                  Double_t                zvtx)
 {
   // 
   // Do the calculations 
@@ -327,6 +332,10 @@ AliFMDDensityCalculator::Calculate(const AliESDFMD&        fmd,
          Float_t  mult = fmd.Multiplicity(d,r,s,t);
          Float_t  phi  = fmd.Phi(d,r,s,t) / 180 * TMath::Pi();
          Float_t  eta  = fmd.Eta(d,r,s,t);
+        
+         
+         if(fRecalculateEta)  
+           eta = AliForwardUtil::GetEtaFromStrip(d,r,s,t,zvtx);
          
          if (mult == AliESDFMD::kInvalidMult || mult > 20) {
            rh->fPoisson.Fill(t , s, false);
@@ -373,6 +382,8 @@ AliFMDDensityCalculator::Calculate(const AliESDFMD&        fmd,
          Double_t poissonV = poisson->GetBinContent(t+1,s+1);
          Double_t  phi  = fmd.Phi(d,r,s,t) / 180 * TMath::Pi();
          Double_t  eta  = fmd.Eta(d,r,s,t);
+         if(fRecalculateEta)  
+           eta = AliForwardUtil::GetEtaFromStrip(d,r,s,t,zvtx);
          if (fUsePoisson)
            h->Fill(eta,phi,poissonV);
          else
index 188dc63fa84204e635de506a4ee6b965a3c4c11d..bcf3e740e26decb81a71dcae18e9d65056b594b1 100644 (file)
@@ -106,7 +106,7 @@ public:
    */
   virtual Bool_t Calculate(const AliESDFMD& fmd, 
                           AliForwardUtil::Histos& hists, 
-                          UShort_t vtxBin, Bool_t lowFlux, Double_t cent=-1);
+                          UShort_t vtxBin, Bool_t lowFlux, Double_t cent=-1, Double_t vz=0);
   /** 
    * Scale the histograms to the total number of events 
    * 
@@ -147,6 +147,13 @@ public:
    * number of particles that has hit within a region.
    */
   void SetUsePoisson(Bool_t u) { fUsePoisson = u; }
+  /** 
+   * In case of a displaced vertices recalculate eta and angle correction
+   * 
+   * @param use recalculate or not
+   * 
+   */
+  void SetRecalculateEta(Bool_t use) { fRecalculateEta = use; }
   /** 
    * Set whether to use the phi acceptance correction. 
    * 
@@ -157,6 +164,7 @@ public:
    *
    * @param u If >0, use the phi acceptance (default is false)
    */
+   
   void SetUsePhiAcceptance(UShort_t u=kPhiCorrectNch) { fUsePhiAcceptance = u; }
   /** 
    * Set the luming factors used in the Poisson method
@@ -394,6 +402,7 @@ protected:
   Int_t    fPhiLumping;    //  How to lump phi bins for Poisson 
   Int_t    fDebug;         //  Debug level 
   AliFMDMultCuts fCuts;    // Cuts
+  Bool_t fRecalculateEta;  //  //Whether to recalculate eta and angle correction (disp vtx)
 
   ClassDef(AliFMDDensityCalculator,7); // Calculate Nch density 
 };
index 17d1418ac7ae5b70354f6b5f3806514ceae607ff..2e451d378d264bffa033d5e837fe0b06a8bd0d24 100644 (file)
@@ -63,7 +63,8 @@ AliFMDSharingFilter::AliFMDSharingFilter()
     fLCuts(),
     fHCuts(),
     fUseSimpleMerging(false),
-    fThreeStripSharing(true)
+    fThreeStripSharing(true),
+    fRecalculateEta(false)
 {
   // 
   // Default Constructor - do not use 
@@ -84,7 +85,8 @@ AliFMDSharingFilter::AliFMDSharingFilter(const char* title)
     fLCuts(),
     fHCuts(),
     fUseSimpleMerging(false),
-    fThreeStripSharing(true)
+    fThreeStripSharing(true),
+    fRecalculateEta(false)
 {
   // 
   // Constructor 
@@ -120,7 +122,8 @@ AliFMDSharingFilter::AliFMDSharingFilter(const AliFMDSharingFilter& o)
     fLCuts(o.fLCuts),
     fHCuts(o.fHCuts),
     fUseSimpleMerging(o.fUseSimpleMerging),
-    fThreeStripSharing(o.fThreeStripSharing)
+    fThreeStripSharing(o.fThreeStripSharing),
+    fRecalculateEta(o.fRecalculateEta)
 {
   // 
   // Copy constructor 
@@ -169,6 +172,7 @@ AliFMDSharingFilter::operator=(const AliFMDSharingFilter& o)
   fHCuts                        = o.fHCuts;
   fUseSimpleMerging             = o.fUseSimpleMerging;
   fThreeStripSharing            = o.fThreeStripSharing;
+  fRecalculateEta               = o.fRecalculateEta;
   
   fRingHistos.Delete();
   TIter    next(&o.fRingHistos);
@@ -252,7 +256,8 @@ AliFMDSharingFilter::Init()
 Bool_t
 AliFMDSharingFilter::Filter(const AliESDFMD& input, 
                            Bool_t           lowFlux,
-                           AliESDFMD&       output)
+                           AliESDFMD&       output, 
+                           Double_t         zvtx)
 {
   // 
   // Filter the input AliESDFMD object
@@ -321,6 +326,25 @@ AliFMDSharingFilter::Filter(const AliESDFMD& input,
          Double_t phi = input.Phi(d,r,s,t) * TMath::Pi() / 180.;
          if (s == 0) output.SetEta(d,r,s,t,eta);
          
+         Double_t etaOld  = eta;
+         Double_t etaCalc = 0;
+         if(fRecalculateEta) { 
+           etaCalc = AliForwardUtil::GetEtaFromStrip(d,r,s,t,zvtx);
+           eta = etaCalc;
+         }
+         if(fRecalculateEta && mult > 0 && mult != AliESDFMD::kInvalidMult ) {
+           Double_t cosOld = TMath::Cos(2*TMath::ATan(TMath::Exp(-1*TMath::Abs(etaOld))));
+           Double_t cosNew = TMath::Cos(2*TMath::ATan(TMath::Exp(-1*TMath::Abs(etaCalc))));        
+           if(mult > 0) mult = (mult/cosOld)*cosNew;
+           if(multNext > 0) multNext = (multNext/cosOld)*cosNew;
+           if(multNextNext > 0) multNextNext = (multNextNext/cosOld)*cosNew;
+           
+           //No corrections beyond this point
+           //  if(eta < -4) {
+           //  mult = 0; multNext = 0; multNextNext = 0;
+           // }
+         }
+         
          // Keep dead-channel information. 
          if(mult == AliESDFMD::kInvalidMult)
            output.SetMultiplicity(d,r,s,t,AliESDFMD::kInvalidMult);
index 5667da2cd53bdcaea6c1de79dded2fe25f1ad2d5..4e8a0b995699aed47cbc3489492d210f74f21124 100644 (file)
@@ -132,6 +132,15 @@ public:
    * 
    */
   void SetAllow3Strips(Bool_t use) { fThreeStripSharing = use; }
+  
+  /** 
+   * In case of a displaced vertices recalculate eta and angle correction
+   * 
+   * @param use recalculate or not
+   * 
+   */
+  void SetRecalculateEta(Bool_t use) { fRecalculateEta = use; }
+  
   /** 
    * Filter the input AliESDFMD object
    * 
@@ -143,7 +152,8 @@ public:
    */
   Bool_t Filter(const AliESDFMD& input, 
                Bool_t           lowFlux, 
-               AliESDFMD&       output);
+               AliESDFMD&       output, 
+               Double_t         zvtx);
   /** 
    * Scale the histograms to the total number of events 
    * 
@@ -375,6 +385,7 @@ protected:
   AliFMDMultCuts fHCuts;    //Cuts object for high cuts
   Bool_t   fUseSimpleMerging; //enable simple sharing by HHD
   Bool_t   fThreeStripSharing; //In case of simple sharing allow 3 strips
+  Bool_t   fRecalculateEta; //Whether to recalculate eta and angle correction (disp vtx)
   ClassDef(AliFMDSharingFilter,4); //
 };
 
index 7b1e6bc0d747dedfefc91de520f89340d28fdf9f..520b54bb459bda66f721bc8caa455916b29d6bdb 100644 (file)
@@ -387,7 +387,7 @@ AliForwardMCMultiplicityTask::UserExec(Option_t*)
   AliESDFMD*  esdFMD  = esd->GetFMDData();
 
   // Apply the sharing filter (or hit merging or clustering if you like)
-  if (isAccepted && !fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD)) { 
+  if (isAccepted && !fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD, vz)) { 
     AliWarning("Sharing filter failed!");
     return;
   }
index 20b3052299ad24e21d3a8f49ca2f86fe05b9d864..cfe4c9be25c35a010f6e88740f1f7a325e7ea010 100644 (file)
@@ -289,13 +289,13 @@ AliForwardMultiplicityTask::UserExec(Option_t*)
   // Get FMD data 
   AliESDFMD* esdFMD = esd->GetFMDData();
   //  // Apply the sharing filter (or hit merging or clustering if you like)
-  if (!fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD)) { 
+  if (!fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD, vz)) { 
     AliWarning("Sharing filter failed!");
     return;
   }
   
   // Calculate the inclusive charged particle density 
-  if (!fDensityCalculator.Calculate(fESDFMD, fHistos, ivz, lowFlux, cent)) { 
+  if (!fDensityCalculator.Calculate(fESDFMD, fHistos, ivz, lowFlux, cent,vz)) { 
     // if (!fDensityCalculator.Calculate(*esdFMD, fHistos, ivz, lowFlux)) { 
     AliWarning("Density calculator failed!");
     return;
index 807e96e169cd3395e0a3f6634125c22647dbf4be..01184f1bf79da5b77f9910463d06d3fd38b00395 100644 (file)
@@ -371,7 +371,7 @@ AliForwardQATask::UserExec(Option_t*)
   }
     
   //  // Apply the sharing filter (or hit merging or clustering if you like)
-  if (!fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD)) { 
+  if (!fSharingFilter.Filter(*esdFMD, lowFlux, fESDFMD, vz)) { 
     AliWarning("Sharing filter failed!");
     return;
   }
index 3e3c363148c6d364c338474c4715408c549d5e5b..d13f7e2c3a85c7c4fca14dd20fd2bf6a4b73aebf 100644 (file)
@@ -145,6 +145,42 @@ AliForwardUtil::MagneticFieldString(Short_t f)
   //
   return Form("%01dkG", f);
 }
+//_____________________________________________________________________
+Double_t AliForwardUtil::GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Double_t zvtx)
+{
+  //Calculate eta from strip with vertex (redundant with AliESDFMD::Eta but support displaced vertices)
+  
+  //Get max R of ring
+  Double_t maxR = 0;
+  Double_t minR = 0;
+  Bool_t inner = false;
+  switch (ring) { 
+  case 'i': case 'I': maxR = 17.2; minR =  4.5213; inner = true;  break;
+  case 'o': case 'O': maxR = 28.0; minR = 15.4;    inner = false; break;
+  default: 
+    return -99999;
+  }
+
+  Double_t   rad       =  maxR- minR;
+  Double_t   nStrips   = (ring == 'I' ? 512 : 256);
+  Double_t   segment   = rad / nStrips;
+  Double_t   r         =  minR + segment*strip;
+  Int_t hybrid = sec / 2;
+  
+  Double_t z = 0;
+  switch (det) { 
+  case 1: z = 320.266; break;
+  case 2: z = (inner ? 83.666 : 74.966); break;
+  case 3: z = (inner ? -63.066 : -74.966); break; 
+  default: return -999999;
+  }
+  if ((hybrid % 2) == 0) z -= .5;
+  
+  Double_t   theta = TMath::ATan2(r,z-zvtx);
+  Double_t   eta   = -1*TMath::Log(TMath::Tan(0.5*theta));
+  
+  return eta;
+}
 
 
 //====================================================================
index d0da2db4b3d1b38365bb2bb75c9fb75b911045bd..0ede52d6a5eb5ae8a00f7f68b8471763b86a1a4a 100644 (file)
@@ -113,6 +113,14 @@ public:
    * @return Short integer value of magnetic field in kG 
    */
   static Short_t ParseMagneticField(Float_t field);
+  /** 
+   * Get eta from strip
+   * 
+   * @param det, ring, sec, strip, zvtx
+   * 
+   * @return eta
+   */
+  static Double_t GetEtaFromStrip(UShort_t det, Char_t ring, UShort_t sec, UShort_t strip, Double_t zvtx) ;
   /** 
    * Get a string representation of the magnetic field
    * 
@@ -120,7 +128,7 @@ public:
    * 
    * @return String representation of the magnetic field
    */
-  static const char* MagneticFieldString(Short_t field);
+   static const char* MagneticFieldString(Short_t field);
   /* @} */
 
   /**