Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MadTVAnalysis.h

Go to the documentation of this file.
00001 
00002 //
00003 // MadTVAnalysis
00004 //
00005 // Tricia's MadAnalysis.  Copied from the Feb 3 version of the jan06 branch of 
00006 // MadMKAnalysis
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 //#include "MCReweight/BeamType.h"
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   // fiducial volume and track containment as defined by pitt group
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   // is this strip in the partially instrumented region of the ND?
00057   static Int_t InPartialRegion(UShort_t plane, UShort_t strip);
00058   
00059   // pass back an bitfield with bits corresponding to radial cuts
00060   // Float_t rings[5]={0.1,0.25,0.5,1.0,1.5}; // in meters
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   // PID calculator objects
00077   MadNsID nsid;
00078   MadDpID dpid;
00079   MadQEID qeid;
00080   MadAbID abid;
00081   bool openedabpidfile;
00082   
00083  protected:
00084   // signal inside and outside of the partial plane region
00085   // for whole event and just for track portion
00086   // uses currently loaded event and track  
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   // from base class
00093 //  Float_t RecoAnalysisEnergy(Int_t event);
00094 //  Float_t RecoShwEnergy(int ishw, const Detector::Detector_t& det, int mode=1, bool isdata=true);
00095   //  Float_t RecoMKMuEnergy(Int_t& opt, Int_t itrk, bool isdata=true, Detector::Detector_t det=Detector::kNear);
00096 
00097   //  virtual Bool_t PassBasicCuts(Int_t event);
00098 
00099   // muon angle with respect to neutrino angle
00100   // it's detector dependant!
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   //  virtual Float_t RecoKinematics(Int_t event);
00105 
00106   virtual bool InFidVol(Int_t evidx);
00107   virtual bool InFidVol(); // assumes event already loaded,
00108                            //and that we're interested in event vertex
00109   bool InFidVol(float vx, float vy, float vz); //looks to see if vx,vy,vz 
00110                                                //is in fid. vol
00111 
00112   void SetBECFile(const char* f);
00113   Registry& GetBECRegistry() { return fBECConfig; }
00114 
00115   // number of planes in the reconstructed object
00116   // possibly with a ph cut in pes
00117   // return the sigcor, after the ph cut, in sumph
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   //GetEvtTimeChar assumesevent is already loaded
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   //a function to count the number of reconstructed strips 
00136   //that are in this event and in some other event
00137   //(by reconstructed strips I mean CandStripSR)
00138   void DupRecoStrips(int evidx, int &nduprs, float &dupphrs);
00139   
00140   float ComputeLowPHRatio();
00141   //  bool FDRCBoundary(int p1, int p2);
00142   Int_t FDRCBoundary();
00143   
00144   Float_t GetNDCoilCurrent(const VldContext& vc);
00145 
00146 
00147  private:
00148   
00149   // Z (m) locations in the ND (for fiducial cuts)
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   // xy beam center in ND
00156   static const Float_t kXcenter;
00157   static const Float_t kYcenter;
00158 
00159   //constants for EarlyActivity estimation
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   //  std::string fBECFile; // file for beam energy reweighting
00167   Registry fBECConfig; // config for beam energy reweighting
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

Generated on Mon Feb 15 11:06:56 2010 for loon by  doxygen 1.3.9.1