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

MadDpID.h

Go to the documentation of this file.
00001 
00002 //
00003 // MadDpID
00004 //
00005 // A class to calculate Dave Petyt's CC PID
00006 //
00007 // Created:  D. Petyt -- some time ago
00008 //
00009 // Converted to this format: M. Kordosky, 11 August 2005
00010 //
00011 // $Author: vahle $ 
00012 //
00013 // $Revision: 1.8 $
00014 // 
00015 // $Name:  $
00016 //
00017 // $Id: MadDpID.h,v 1.8 2007/02/05 18:43:47 vahle Exp $
00018 //
00019 // $Log: MadDpID.h,v $
00020 // Revision 1.8  2007/02/05 18:43:47  vahle
00021 // Changed ChoosePDFs in MadDpID to take reconstruction and MC versions as arguments.  This way it can figure out what pdf file to use based on the reco and mc versions.  Should be backwards compatible, if these two new parameters are not specified, the code will assume they are birch/carrot and load the pdf files that were used for the prl analysis
00022 //
00023 // Revision 1.7  2007/01/30 03:17:21  rhatcher
00024 // No longer user BeamType "class" found in MCReweight, but rather the
00025 // BeamType "namespace" found in Conventions package.
00026 // Also covert to using "Detector::" rather than "DetectorType::", though
00027 // for now they are synonyms.
00028 //
00029 // Revision 1.6  2006/05/08 21:27:44  boehm
00030 // Primary change is the addition of functions to calculate the PID's from NtpSt objects.  Both PIDs may now be generated without relying on the rest of the Mad infrastructure.  Mad based code though should not be changed.
00031 //
00032 // Also removed the if(!ntpTrack.fit.pass) return;  from MadDpID.cxx as it does not reflect the current state of the CC analysis. This was removed in the branched version but remained in the development version.
00033 //
00034 // Revision 1.5  2006/05/04 21:32:41  boehm
00035 // Minor adjustment so that there now exists a CalcPid(var1, var2, var3) function
00036 // which generic non-Mad based programs can use to calculate a DP-PID value.
00037 //
00038 // Revision 1.4  2006/03/10 18:57:21  kordosky
00039 // correct MadDpID and MadMKAnalysis to account for 1.8% shift in pulseheight related PID quantities
00040 //
00041 // Revision 1.3  2005/10/06 15:03:26  kordosky
00042 // various improvements, pids finally integrated into pan construction routine, still not fully debugged though
00043 //
00044 // Revision 1.2  2005/09/14 13:32:45  kordosky
00045 // DpID and NsID classes now fully working and validated with MadTestAnalysis by comparing nannpid vs. annpid and npid0 vs. pid0.  pdf files and weights stored in data subdirectory. FD pdfs needed for DpID.
00046 //
00047 //
00049 
00050 
00051 #ifndef maddpid_h
00052 #define maddpid_h
00053 
00054 #include <string>
00055 //#include "Mad/MadQuantities.h"
00056 //#include "TH1.h"
00057 #include "Rtypes.h"
00058 #include "Conventions/Detector.h"
00059 #include "Conventions/BeamType.h"
00060 #include <vector>
00061 
00062 class MadQuantities;
00063 class TH1;
00064 class TFile;
00065 
00066 class NtpSRTrack;
00067 class NtpSREvent;
00068 class NtpSREventSummary;
00069 
00070 
00071 class MadDpID {
00072  public:
00073   MadDpID();
00074   ~MadDpID();
00075 
00076   Float_t CalcPID(MadQuantities* mb, Int_t event, Int_t method);
00077   Float_t CalcPID(const NtpSRTrack* ntpTrack, const NtpSREvent* ntpEvent,
00078          const NtpSREventSummary *eventSummary, Detector::Detector_t det,
00079          Int_t method);
00080   Float_t CalcPID(Float_t var1, Float_t var2, Float_t var3);
00081   bool ReadPDFs(const char* name);
00082   bool ChoosePDFs(const Detector::Detector_t& det, 
00083                   const BeamType::BeamType_t& beam,
00084                   std::string recover="", std::string mcver="");
00085   void InitPDFs(const Detector::Detector_t& det);
00086   bool FillPDFs(MadQuantities* mb, Int_t event,Int_t method,Float_t weight=1);
00087   void WritePDFs(const char* name); 
00088   // set a mult. correction to pulseheight variables calculated
00089   // inside CalcPID() (actually CalcVars() does the relevant work)
00090   // R1.18.2 this should be 1.018 for FD data and unity for all else.
00091   // Note, FillPDFs() would also use the correction if it is set.
00092   void SetPHCorrection(double p=1.0){ph_correction=p;}
00093  private:
00094   void ResetPDFs();
00095   void CheckBinning(const Detector::Detector_t& det);
00096   bool CalcVars(MadQuantities* mb, Int_t event, Int_t method, 
00097                 Float_t& var1, Float_t& var2, Float_t& var3);
00098   bool CalcVars(const NtpSRTrack* ntpTrack, const NtpSREvent* ntpEvent,
00099          const NtpSREventSummary *eventSummary, Detector::Detector_t det,
00100          Int_t method, Float_t& var1, Float_t& var2, Float_t& var3);
00101 
00102 
00103 
00104   double ph_correction;
00105 
00106   Detector::Detector_t cache_det;
00107   BeamType::BeamType_t cache_beam; 
00108   
00109   std::vector<TH1*> fLikeliHist;
00110 
00111 };
00112 #endif

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