00001
00002
00003
00004
00005
00006
00007
00009
00010 #ifndef MADTVANALYSIS
00011 #define MADTVANALYSIS
00012
00013 #include <string>
00014
00015 #include "Mad/MadAnalysis.h"
00016 #include "Conventions/PlaneCoverage.h"
00017 #include "Conventions/PlaneView.h"
00018 #include "Conventions/Detector.h"
00019 #include "Registry/Registry.h"
00020
00021
00022 #include "Conventions/BeamType.h"
00023 #include "PhysicsNtuple/Store/Interface.h"
00024
00025 #include "Mad/MadNsID.h"
00026 #include "Mad/MadDpID.h"
00027 #include "Mad/MadQEID.h"
00028 #include "Mad/MadAbID.h"
00029
00030 class TFile;
00031 class VldContext;
00032
00033 class MadTVAnalysis : public MadAnalysis {
00034
00035 public:
00036 void CreatePAN(std::string s, const char* bmonpath="");
00037 MadTVAnalysis(TChain *chainSR=0,TChain *chainMC=0,
00038 TChain *chainTH=0,TChain *chainEM=0);
00039 MadTVAnalysis(JobC *,string,int);
00040 virtual ~MadTVAnalysis();
00041
00042 Float_t ClosestPointToLine(const Float_t& x1,
00043 const Float_t& y1,
00044 const Float_t& x2,
00045 const Float_t& y2,
00046 const Float_t& xpt,
00047 const Float_t& ypt,
00048 Float_t& x, Float_t& y);
00049
00050
00051 static Bool_t PittInFidVol(Float_t x, Float_t y,
00052 Float_t z, Float_t u, Float_t v);
00053 static Int_t PittTrkContained(Float_t x, Float_t y,
00054 Float_t z, Float_t u, Float_t v);
00055
00056
00057 static Int_t InPartialRegion(UShort_t plane, UShort_t strip);
00058
00059
00060
00061 static Int_t NDRadialFidVol(Float_t x,Float_t y, Float_t z);
00062
00063 void ForceMCBeam(const BeamType::BeamType_t& beam) {fMCBeam=beam;}
00064 const BeamType::BeamType_t& GetForcedMCBeam() {return fMCBeam;}
00065 void SetDataUseMCBeam(bool x) {fDataUseMCBeam=x;}
00066
00067 void FillMCHists(TFile* fout);
00068
00069 static int FarTrkContained(Float_t x, Float_t y, Float_t z);
00070
00071 void SetRustemNearPID(string fname) {rustempidfile_near=fname;}
00072 void SetRustemFarPID(string fname) {rustempidfile_far=fname;}
00073 void SetRustemConfig(string fname) {rustemconfigfile=fname;}
00074
00075
00076
00077 MadNsID nsid;
00078 MadDpID dpid;
00079 MadQEID qeid;
00080 MadAbID abid;
00081 bool openedabpidfile;
00082
00083 protected:
00084
00085
00086
00087 void SigInOut(Float_t& sigfull, Float_t& sigpart, Float_t& trkfull, Float_t& trkpart);
00088 void SigInOut(Int_t trkidx, Float_t& sigfull, Float_t& sigpart, Float_t& trkfull, Float_t& trkpart);
00089
00090
00091
00093
00094
00095
00096
00097
00098
00099
00100
00101 virtual Float_t RecoMuDCosNeuND(Int_t itr=0, Float_t* vtx=0);
00102 virtual Float_t RecoMuDCosNeuFD(Int_t itr=0, Float_t* vtx=0);
00103
00104
00105
00106 virtual bool InFidVol(Int_t evidx);
00107 virtual bool InFidVol();
00108
00109 bool InFidVol(float vx, float vy, float vz);
00110
00111
00112 void SetBECFile(const char* f);
00113 Registry& GetBECRegistry() { return fBECConfig; }
00114
00115
00116
00117
00118 Int_t NPlanesInObj(TObject *rec, TObject *obj, float phcut, float& sumph);
00119 Int_t NStripsInObj(TObject *rec, TObject *obj, float phcut, float& sumph);
00120
00121 void GetEvtTimeChar(double &timemin, double &timemax, double &timeln);
00122 void GetEvtTimeCharPHC(double &timemin, double &timemax, double &timeln);
00123
00124 int FindBatchNumber(double mintimediff);
00125
00126 float MuonShowerEnergy(const NtpSREvent* evt, const NtpSRTrack* trk);
00127
00128 void EarlyActivity(int evidx, float &earlywph, float &earlywphpw,
00129 float &earlywphsphere, float &ph1000,
00130 float &ph500, float &ph100,
00131 float &lateph1000,
00132 float &lateph500, float &lateph100,
00133 float &lateph50);
00134
00135
00136
00137
00138 void DupRecoStrips(int evidx, int &nduprs, float &dupphrs);
00139
00140 float ComputeLowPHRatio();
00141
00142 Int_t FDRCBoundary();
00143
00144 Float_t GetNDCoilCurrent(const VldContext& vc);
00145
00146
00147 private:
00148
00149
00150 static const Float_t kVetoEndZ;
00151 static const Float_t kTargEndZ;
00152 static const Float_t kCalorEndZ;
00153 static const Float_t kHalfCalorEndZ;
00154 static const Float_t kSpecEndZ;
00155
00156 static const Float_t kXcenter;
00157 static const Float_t kYcenter;
00158
00159
00160 static const Double_t fEarlyActivityWindowSize;
00161 static const Double_t fPMTTimeConstant;
00162 static const Int_t fNPlaneEarlyAct;
00163 static const Double_t fEarlyPlaneSphere;
00164
00165
00166
00167 Registry fBECConfig;
00168 BeamType::BeamType_t fMCBeam;
00169 bool fDataUseMCBeam;
00170
00171 Anp::Interface *phnti;
00172 string rustempidfile_near;
00173 string rustempidfile_far;
00174 string rustemconfigfile;
00175
00176 };
00177
00178 #endif