Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members

TTools.h

Go to the documentation of this file.
00001 
00002 // Class TTools
00003 //
00004 // Author     : F. Cassol Brunner
00005 // Created    : 12/9/2002
00006 // Last update: $Date: 2005/06/28 21:19:21 $
00007 //          by: $Author: sauvan $
00008 // Comment: class for general tool routines
00010 
00011 #ifndef __TTOOLS
00012 #define __TTOOLS
00013 
00014 #include <cstdio>
00015 #include <cstdlib> 
00016 #include <iostream> 
00017 #include <fstream> 
00018 
00019 #include "H1Skeleton/H1Tree.h"
00020 #include "H1Pointers/H1BytePtr.h"
00021 #include "H1Pointers/H1IntPtr.h"
00022 #include "H1Pointers/H1ShortPtr.h"
00023 #include "H1Pointers/H1FloatPtr.h"
00024 #include "H1Mods/H1PartSelTrack.h"
00025 #include "H1Mods/H1PartMuon.h"
00026 #include <TKey.h>
00027 #include <TVector3.h>
00028 
00029 #define MYR2D 180.0/3.14159265359
00030 
00031 // Definition of DATA/MC convention
00032 #define DATAID 0
00033 #define MCDJANGONCID 1
00034 #define MCDJANGOCCID 2
00035 #define MCGPRODDIRID 3
00036 #define MCGPRODRESID 4
00037 #define MCGPRODCCID 5
00038 #define MCGPRODBBID 6
00039 #define MCRAPGAPNCID 7
00040 #define MCGRAPEID 8
00041 #define MCEPVECID 9
00042 #define MCCOMPTONID 10
00043 
00044 
00045 // Define B Field constants for track extrapolation
00046 #define BFIELDCONST 0.0003
00047 #define BFIELDNOM   11.6083
00048 
00049 // Define calorimeter radius
00050 #define rCalo 100.5
00051 
00052 // Define z of BBE, backward detector and IF1
00053 #define zBACKDET -150.0
00054 #define zEDBBE -218.5
00055 #define zIF1 292.0
00056 
00057 
00058 using namespace std;
00059 
00060 class TTools {
00061 public:
00062   Int_t num;                       // event counter
00063   Int_t numMax;                    // maximum number of events
00064 
00065   Int_t RunNumber;                 // Runnumber
00066   Int_t EventNumber;               // Eventnumber
00067   Bool_t NewRun;                   // Set to kTrue if new run started
00068   Float_t GenPl;
00069   Float_t GenPp;
00070   Short_t MCFlag;                  // Flag pour MC 
00071 
00072   TTools();
00073   TTools(Int_t Run, Int_t Event,Int_t MCFlag);
00074 
00075   virtual Bool_t Next();
00076 
00077 //--- set an event list to the tree
00078   void SetEventList(Char_t *ListFileName);
00079 
00080 //--- Which data set is being analysed
00081   Bool_t IsData2005(void);
00082   Bool_t IsData2004e(void);
00083   Bool_t IsData2004p(void);
00084   Bool_t IsData0304R1(void);
00085   Bool_t IsData0304L1(void);
00086   Bool_t IsData0304L2(void);
00087   Bool_t IsData0304R2(void);
00088   Bool_t IsData2003(void);
00089   Bool_t IsData2002(void);
00090   Bool_t IsDataHeraII(void);
00091   Bool_t IsData2000(void);
00092   Bool_t IsData1999p(void);
00093   Bool_t IsData1999e(void);
00094   Bool_t IsData1998(void);
00095   Bool_t IsData1997(void);
00096   Bool_t IsData1996(void);
00097   Bool_t IsData1995(void);
00098   Bool_t IsData1994(void);
00099 
00100   Bool_t IsData94(const UInt_t& irun);
00101   Bool_t IsData95S(const UInt_t& irun);
00102   Bool_t IsData95P(const UInt_t& irun);
00103   Bool_t IsData96P(const UInt_t& irun);
00104   Bool_t IsData97P(const UInt_t& irun);
00105   Bool_t IsData97S(const UInt_t& irun);
00106   Bool_t IsData98E(const UInt_t& irun);
00107   Bool_t IsData99S(const UInt_t& irun);
00108   Bool_t IsData99E(const UInt_t& irun);
00109   Bool_t IsData99P(const UInt_t& irun);
00110   Bool_t IsData00S(const UInt_t& irun);
00111   Bool_t IsData00P(const UInt_t& irun);
00112 
00113 
00114 //--- Test trigger bits
00115   Bool_t IsL4Trigg(Int_t iTrigg);
00116   Bool_t IsL1Trigg(Int_t iTrigg);
00117   Bool_t IsL2TTTrigg(Int_t iTrigg);
00118 
00119   // Are HV bits on
00120   Bool_t IsHV(void);
00121   Bool_t IsHVCJCLoose(void);
00122   Bool_t IsCjcLooseOn();  
00123 
00124 //--- Are CIP/COP on ?
00125   Bool_t IsCipCopOn();
00126 
00127 //--- Is CIP on ?
00128   Bool_t IsCipOn();
00129 
00130   Bool_t IsBdcOn();
00131   Bool_t IsFmdOn();
00132   Bool_t IsPlugOn();
00133 
00134   // Is cosmic
00135   Bool_t IsCosmic(void) ;
00136   Bool_t IsIbgBit(Int_t iBit);
00137 
00138   // Is Special CC cosmic
00139   Bool_t IsCCCosmic(void);
00140 
00141 
00142   // Is NOISE or cosmic
00143   Bool_t IsNonEP();
00144   Bool_t IsNonEP03(void);
00145 
00146   // Is E-Pz physical (E-Pz < 75 GeV)
00147   Bool_t IsEPzOK(Float_t Epz);
00148 
00149   // Is Phi Crack
00150   Bool_t IsPhiCrack(Float_t Phi);
00151   Bool_t IsLArCrack(Float_t z,Float_t phi);
00152   Bool_t IsLArCrack(Float_t z,Float_t zBBE,Float_t phi);
00153 
00154   // Is z Crack
00155   Bool_t IsZCrack(Float_t z);
00156 
00157 //--- Is timing ok
00158   Bool_t IsTimingOk();
00159   Bool_t Is2004CalibratedTimingOK(void);
00160 
00161   // Is CJC dead (Dead periond in 1999 data)
00162   Bool_t IsCJCDead(Float_t PhiTr);
00163   Bool_t IsCJCMCDead(Float_t PhiTr);
00164 
00165   // Is Q2 OK (Combination of diff. MCs)
00166   Bool_t IsMCQ2OK(void);
00167 
00168   Bool_t IsHVCaloCJC(void);
00169 
00170 
00171   // Calibrate jets with calib of qhadcor_98_00
00172   Float_t abscor(Int_t icalfac,Float_t theta_rad,Float_t ptj,Float_t qvar);
00173 
00174   // Get phi angle of 2 particles
00175   Double_t GetMod(Double_t x, Double_t y);
00176   Double_t GetRealPhi(Double_t PhiIn);
00177   Double_t GetMergedPhi(Double_t PhiPart1,Double_t PtPart1,Double_t PhiPart2,Double_t PtPart2);
00178   
00179   // Phi projection into (-22.5,22.5) to see cracks
00180   Double_t GetProjPhi(Double_t Phi);
00181 
00182 //---- test grade of muon
00183   Int_t GetMuonGrade(H1PartMuon *Muon);
00184 
00185  //... Read in noise runs
00186   Bool_t ReadNoiseRuns(Char_t *InputFile);
00187 
00188  
00189 
00190   // QHADCOR calibration: NOT FULLY IMPLEMENTED
00191   Float_t qhadcor_98_00(Int_t ITRA,Int_t ITYPE,Float_t jetpos,Float_t ptin,Float_t qvar);
00192   Float_t qhadcor_98_00_trans(Int_t *itra,Int_t *itype,Float_t *jetpos,Float_t *ptin, Float_t *qvar);
00193 
00194 
00195 //---- for track extrapolations
00196   void CalcExtraPolTrack(TVector3 XStart,H1PartSelTrack *Track,
00197                 Float_t &XOut,Float_t &YOut,Float_t &ZOut,Float_t &ThTrOut,Float_t &PhTrOut);
00198   void OctgXY(Float_t *xl,Float_t phi,Int_t ic,Float_t rc,
00199                                 Float_t roctog,Float_t *xout,Int_t &iflag);
00200   Int_t OctogonIntersection(TVector3 ClusStart,Float_t Theta, Float_t Phi,
00201         Float_t RCurv,Float_t Zmin,Float_t Zmax,Float_t RBarr,TVector3 &XOut,Float_t &PhiOut);
00202   void LinCir(Float_t *xl,Float_t phi,Float_t *xc,Float_t rc,
00203                         Float_t *xy1, Float_t *xy2, Int_t &iflag);
00204   
00205 
00206   ClassDef(TTools,1) // Make class known to root 
00207 };
00208 
00209 #endif

Generated on Thu Jul 28 11:48:53 2005 for SFHMarana by doxygen 1.3.2