]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Moving the FMD offline trigger to its own class, AliFMDOfflineTrigger
authorhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Sep 2009 12:53:33 +0000 (12:53 +0000)
committerhdalsgaa <hdalsgaa@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 17 Sep 2009 12:53:33 +0000 (12:53 +0000)
FMD/AliFMDOfflineTrigger.cxx [new file with mode: 0644]
FMD/AliFMDOfflineTrigger.h [new file with mode: 0644]
FMD/AliFMDParameters.cxx
FMD/AliFMDParameters.h
FMD/AliFMDReconstructor.cxx
FMD/AliFMDReconstructor.h
FMD/FMDrecLinkDef.h
FMD/libFMDrec.pkg

diff --git a/FMD/AliFMDOfflineTrigger.cxx b/FMD/AliFMDOfflineTrigger.cxx
new file mode 100644 (file)
index 0000000..bf785fe
--- /dev/null
@@ -0,0 +1,123 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+//____________________________________________________________________
+//                                                                          
+// This class implements the FMD offline trigger as requested for 
+// ALICE first physics.
+// 
+// 
+// 
+//
+#include "AliFMDOfflineTrigger.h"      
+#include <iostream>
+#include "AliESDFMD.h"
+
+//____________________________________________________________________
+ClassImp(AliFMDOfflineTrigger)
+#if 0
+  ; // This is here to keep Emacs for indenting the next line
+#endif
+
+//____________________________________________________________________
+AliFMDOfflineTrigger::AliFMDOfflineTrigger() : 
+  fLowCut(0.2),
+  fHitCut(0.5)
+{
+  // CTOR 
+
+}
+
+//____________________________________________________________________
+AliFMDOfflineTrigger::AliFMDOfflineTrigger(const AliFMDOfflineTrigger& o)
+  : TObject(o),
+    fLowCut(o.fLowCut),
+    fHitCut(o.fHitCut)
+{
+  
+  // Copy Ctor 
+}
+
+//____________________________________________________________________
+AliFMDOfflineTrigger&
+AliFMDOfflineTrigger::operator=(const AliFMDOfflineTrigger& o)
+{
+  // Assignment operator 
+  return (*this);
+}
+//_____________________________________________________________________
+Bool_t AliFMDOfflineTrigger::ASideHasHit(AliESDFMD* fmd) {
+
+  Float_t totalMult = 0;
+  for(UShort_t det=1;det<=2;det++) {
+    Int_t nRings = (det == 1 ? 1 : 2);
+    for (UShort_t ir = 0; ir < nRings; ir++) {
+      Char_t   ring = (ir == 0 ? 'I' : 'O');
+      UShort_t nsec = (ir == 0 ? 20  : 40);
+      UShort_t nstr = (ir == 0 ? 512 : 256);
+      for(UShort_t sec =0; sec < nsec;  sec++)  {
+       for(UShort_t strip = 0; strip < nstr; strip++) {
+         Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
+         if(mult == AliESDFMD::kInvalidMult) continue;
+         
+         if(mult > fLowCut)
+           totalMult = totalMult + mult;
+         else
+           {
+             if( totalMult > fHitCut) {
+               return kTRUE;
+             }
+             else totalMult = 0 ;
+           }
+       }
+      }
+    }
+  }
+  return kFALSE;
+  
+}
+//_____________________________________________________________________
+Bool_t AliFMDOfflineTrigger::CSideHasHit(AliESDFMD* fmd) {
+  
+  Float_t totalMult = 0;
+  UShort_t det = 3;
+  Int_t nRings = 2;
+  for (UShort_t ir = 0; ir < nRings; ir++) {
+    Char_t   ring = (ir == 0 ? 'I' : 'O');
+    UShort_t nsec = (ir == 0 ? 20  : 40);
+    UShort_t nstr = (ir == 0 ? 512 : 256);
+    for(UShort_t sec =0; sec < nsec;  sec++)  {
+      for(UShort_t strip = 0; strip < nstr; strip++) {
+       Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
+       if(mult == AliESDFMD::kInvalidMult) continue;
+       
+       if(mult > fLowCut)
+         totalMult = totalMult + mult;
+       else
+         {
+           if( totalMult > fHitCut) {
+             return kTRUE;
+           }
+           else totalMult = 0 ;
+         }
+      }
+    }
+  }
+  return kFALSE;
+}
+//____________________________________________________________________
+//
+// EOF
+//
diff --git a/FMD/AliFMDOfflineTrigger.h b/FMD/AliFMDOfflineTrigger.h
new file mode 100644 (file)
index 0000000..b88508b
--- /dev/null
@@ -0,0 +1,57 @@
+#ifndef ALIFMDOFFLINETRIGGER_H
+#define ALIFMDOFFLINETRIGGER_H
+/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
+ * reserved. 
+ *
+ * See cxx source for full Copyright notice                               
+ */
+//____________________________________________________________________
+// 
+// This class implements the FMD offline trigger as requested for 
+// ALICE first physics.  
+//
+//
+
+
+#include "TObject.h"
+
+class AliESDFMD;
+//____________________________________________________________________
+/** @brief FMD offline trigger class
+    @ingroup FMD_rec
+*/
+class AliFMDOfflineTrigger : public TObject 
+{
+public:
+  /** CTOR */
+  AliFMDOfflineTrigger();
+  /** DTOR */
+  ~AliFMDOfflineTrigger() {}
+  /** Copy ctor 
+      @param o Object to copy from  */
+  AliFMDOfflineTrigger(const AliFMDOfflineTrigger& o);
+  
+  AliFMDOfflineTrigger& operator=(const AliFMDOfflineTrigger& o);
+    
+  Bool_t ASideHasHit(AliESDFMD* fmd);
+  Bool_t CSideHasHit(AliESDFMD* fmd);
+  void   SetLowCut(Float_t lowcut) {fLowCut = lowcut;}
+  void   SetHitCut(Float_t hitcut) {fHitCut = hitcut;}
+private:
+  
+  Float_t fLowCut;
+  Float_t fHitCut;
+  
+  ClassDef(AliFMDOfflineTrigger, 1) 
+};
+
+
+#endif
+//____________________________________________________________________
+//
+// Local Variables:
+//   mode: C++
+// End:
+//
+
+
index d5b8eb1366a0db3b7886b236eb2b74840e9321fe..86a87d2036eed1d03864250ce7912b57861f38bc 100644 (file)
@@ -105,9 +105,7 @@ AliFMDParameters::AliFMDParameters()
     fPulseGain(0), 
     fDeadMap(0), 
     fAltroMap(0), 
-    fStripRange(0),
-    fOfflineTriggerLowCut(0.1),
-    fOfflineTriggerHitCut(0.6)
+    fStripRange(0)
 {
   // Default constructor 
   SetVA1MipRange();
index fcd04fd68e19fb4928017f99c43ab99641a45e62..c8c05127d486dfa82de704492ba24ee077a29890 100644 (file)
@@ -493,11 +493,6 @@ public:
   static const char* GetGainShuttleID()       {return fkGainShuttleID;}
   static const char* GetConditionsShuttleID()   {return fkConditionsShuttleID;}
   
-  Float_t GetOfflineTriggerLowCut() {return fOfflineTriggerLowCut;}
-  Float_t GetOfflineTriggerHitCut() {return fOfflineTriggerHitCut;}
-  void    SetOfflineTriggerLowCut(Float_t cut) {fOfflineTriggerLowCut = cut;}
-  void    SetOfflineTriggerHitCut(Float_t cut) {fOfflineTriggerHitCut = cut;}
-
 protected:
   /** CTOR  */
   AliFMDParameters();
@@ -529,9 +524,7 @@ protected:
       fPulseGain(o.fPulseGain),
       fDeadMap(o.fDeadMap),
       fAltroMap(o.fAltroMap),
-      fStripRange(o.fStripRange),
-      fOfflineTriggerLowCut(o.fOfflineTriggerLowCut),
-      fOfflineTriggerHitCut(o.fOfflineTriggerHitCut)
+      fStripRange(o.fStripRange)
   {}
   /** Assignement operator 
       @return Reference to this */
@@ -617,9 +610,6 @@ protected:
   AliFMDAltroMapping*         fAltroMap;        // Map of hardware
   AliFMDCalibStripRange*      fStripRange;      // Strip range
   
-  Float_t                fOfflineTriggerLowCut; //offline trigger low cut
-  Float_t                fOfflineTriggerHitCut; //offline trigger hit cut
-  
   ClassDef(AliFMDParameters,6) // Manager of parameters
 };
 
index efaed9f13d7557b465d6d849853142422d6a1355..a4eca072f7799b124361ed4543381d799441c2a8 100644 (file)
@@ -877,69 +877,6 @@ AliFMDReconstructor::FillESD(AliRawReader*, TTree* clusterTree,
   TTree* dummy = 0;
   FillESD(dummy, clusterTree, esd);
 }
-//_____________________________________________________________________
-Bool_t AliFMDReconstructor::GetFMDAsideBit(AliESDFMD* fmd) {
-
-  AliFMDParameters* pars = AliFMDParameters::Instance();
-  Float_t totalMult = 0;
-  for(UShort_t det=1;det<=2;det++) {
-    Int_t nRings = (det == 1 ? 1 : 2);
-    for (UShort_t ir = 0; ir < nRings; ir++) {
-      Char_t   ring = (ir == 0 ? 'I' : 'O');
-      UShort_t nsec = (ir == 0 ? 20  : 40);
-      UShort_t nstr = (ir == 0 ? 512 : 256);
-      for(UShort_t sec =0; sec < nsec;  sec++)  {
-       for(UShort_t strip = 0; strip < nstr; strip++) {
-         Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
-         if(mult == AliESDFMD::kInvalidMult) continue;
-         
-         if(mult > pars->GetOfflineTriggerLowCut())
-           totalMult = totalMult + mult;
-         else
-           {
-             if( totalMult > pars->GetOfflineTriggerHitCut()) {
-               return kTRUE;
-             }
-             else totalMult = 0 ;
-           }
-       }
-      }
-    }
-  }
-  return kFALSE;
-  
-}
-//_____________________________________________________________________
-Bool_t AliFMDReconstructor::GetFMDCsideBit(AliESDFMD* fmd) {
-  
-  AliFMDParameters* pars = AliFMDParameters::Instance();
-  Float_t totalMult = 0;
-  UShort_t det = 3;
-  Int_t nRings = 2;
-  for (UShort_t ir = 0; ir < nRings; ir++) {
-    Char_t   ring = (ir == 0 ? 'I' : 'O');
-    UShort_t nsec = (ir == 0 ? 20  : 40);
-    UShort_t nstr = (ir == 0 ? 512 : 256);
-    for(UShort_t sec =0; sec < nsec;  sec++)  {
-      for(UShort_t strip = 0; strip < nstr; strip++) {
-       Float_t mult = fmd->Multiplicity(det,ring,sec,strip);
-       if(mult == AliESDFMD::kInvalidMult) continue;
-       
-       if(mult > pars->GetOfflineTriggerLowCut())
-         totalMult = totalMult + mult;
-       else
-         {
-           if( totalMult > pars->GetOfflineTriggerHitCut()) {
-             return kTRUE;
-           }
-           else totalMult = 0 ;
-         }
-      }
-    }
-  }
-  return kFALSE;
-}
 //____________________________________________________________________
 //
 // EOF
index 049979e1828e6bd02f5afc90dc051dc37400bac4..499d85fb928b9b32c034263e5b61b5260a694f9b 100644 (file)
@@ -160,17 +160,7 @@ public:
    * @param use If true, make the diagnostics file 
    */
   void SetDiagnose(Bool_t use=kTRUE) { fDiagnostics = use; }
-   /** 
-   * Functions to use the FMD as an offline trigger. The idea is to read
-   * the data until we are certain we have one particle. If no particle is 
-   * found the functions return kFALSE. These functions were added as a 
-   * result of the discussions in the First Physics Working Group.
-   *    *
-   * @param AliESDFMD* fmd the FMD data from one event.
-   */
-  static Bool_t GetFMDAsideBit(AliESDFMD* fmd);
-  static Bool_t GetFMDCsideBit(AliESDFMD* fmd);
-  
+    
 protected:
   /** 
    * Copy CTOR 
index 0ec214b96c5661fea002677221e1eebada506b99..00f56d0e823a7b6f6941378616637b95d38d663a 100644 (file)
@@ -25,6 +25,7 @@
 #pragma link C++ class  AliFMDRawStream+;
 #pragma link C++ class  AliFMDRawReader+;
 #pragma link C++ class  AliFMDQADataMakerRec+;
+#pragma link C++ class  AliFMDOfflineTrigger+;
 
 #else
 # error Not for compilation 
index 888d4afa5e173ef3d97e907410fc853da7a77d9d..bab58420471aed889d943425f1cd9fc8724d2d23 100644 (file)
@@ -7,7 +7,8 @@ SRCS            =  AliFMDReconstructor.cxx      \
                   AliFMDRawStream.cxx          \
                   AliFMDRawReader.cxx          \
                   AliFMDRecPoint.cxx           \
-                  AliFMDQADataMakerRec.cxx             
+                  AliFMDQADataMakerRec.cxx     \
+                  AliFMDOfflineTrigger.cxx
 
 HDRS           =  $(SRCS:.cxx=.h)
 DHDR           := FMDrecLinkDef.h