MajorityCurvature Class Reference

#include <MajorityCurvature.h>

List of all members.

Public Member Functions

 MajorityCurvature ()
virtual ~MajorityCurvature ()
virtual MajCInfo CalcCurvObject (const std::multimap< Float_t, Float_t > md, const Int_t fitLength) const
virtual MajCInfo CalcCurvObjectFast (const std::multimap< Float_t, Float_t > md, const Int_t fitLength) const
virtual Float_t Curvature (const MomNavigator *mom, const Int_t event, const Int_t track) const
virtual MajCInfo CurvatureImproved (const NtpSRTrack *track) const
virtual MajCInfo CurvatureImproved (const MomNavigator *mom, const Int_t event, const Int_t track) const
virtual Float_t Curvature (const NtpSRTrack *track) const
virtual Float_t CurvatureComb (const MomNavigator *mom, const Int_t event, const Int_t track) const
virtual Int_t FitLength (const Int_t trkLthPln) const
virtual Double_t JPID (const Double_t qOverP, const Double_t majC) const
virtual Int_t NextFitLength (const Int_t trkLthPln, const Int_t lastFitLength) const
virtual Float_t XCurvature (const MomNavigator *mom, const Int_t event, const Int_t track) const
virtual MajCInfo XCurvatureObject (const MomNavigator *mom, const Int_t event, const Int_t track) const
virtual MajCInfo XCurvatureObject (const NtpSRTrack *track) const
virtual Float_t XCurvature (const NtpSRTrack *track) const
virtual Float_t YCurvature (const MomNavigator *mom, const Int_t event, const Int_t track) const
virtual MajCInfo YCurvatureObject (const MomNavigator *mom, const Int_t event, const Int_t track) const
virtual MajCInfo YCurvatureObject (const NtpSRTrack *track) const
virtual Float_t YCurvature (const NtpSRTrack *track) const

Static Public Attributes

static TH1F * hvariances = new TH1F("hvariances","",200,-5,5)

Private Member Functions

virtual Float_t CalcCombCurv (const MomNavigator *mom, const Int_t event, const Int_t track, const Int_t fitLength) const
virtual Float_t CalcCurv (const std::multimap< Float_t, Float_t > md, const Int_t fitLength) const
virtual Float_t CalcXCurv (const MomNavigator *mom, const Int_t event, const Int_t track, const Int_t fitLength) const
virtual MajCInfo CalcXCurvObject (const MomNavigator *mom, const Int_t event, const Int_t track, const Int_t fitLength) const
virtual MajCInfo CalcXCurvObject (const NtpSRTrack *track, const Int_t fitLength) const
virtual Float_t CalcXCurv (const NtpSRTrack *track, const Int_t fitLength) const
virtual Float_t CalcYCurv (const MomNavigator *mom, const Int_t event, const Int_t track, const Int_t fitLength) const
virtual MajCInfo CalcYCurvObject (const MomNavigator *mom, const Int_t event, const Int_t track, const Int_t fitLength) const
virtual MajCInfo CalcYCurvObject (const NtpSRTrack *track, const Int_t fitLength) const
virtual Float_t CalcYCurv (const NtpSRTrack *track, const Int_t fitLength) const

Private Attributes

TH1D * fhMajCBa
TH1D * fhMajCNC
TH1D * fhMajCNu
TH1D * fhQOverPBa
TH1D * fhQOverPNC
TH1D * fhQOverPNu
TFile * fPDFFile
Int_t fitLengths [500][500]

Detailed Description

Definition at line 74 of file MajorityCurvature.h.


Constructor & Destructor Documentation

MajorityCurvature::MajorityCurvature (  ) 

Definition at line 130 of file MajorityCurvature.cxx.

References exit(), NuGeneral::GetReleaseDirToUse(), Msg::kDebug, Msg::kError, and MSG.

00131 {
00132 
00133 //     topDir="MCReweight/data";
00134 //     std::string base="";
00135 //     base=getenv("SRT_PRIVATE_CONTEXT");
00136 //     if(base=="" || base==".") base=getenv("SRT_PUBLIC_CONTEXT");
00137 //     if(base=="") {
00138 //       cout<<"No SRT_PUBLIC_CONTEXT set"<<std::endl;
00139 //       assert(false);
00140 //     }
00141 //     topDir = base+ "/" + topDir;
00142 
00143 
00144   TDirectory* tmpd = gDirectory;
00145   MSG("MajorityCurvature",Msg::kDebug)
00146     <<"TDirectory before opening file is:"<<endl;
00147   //tmpd->Print();
00148     
00149   const NuGeneral& general=NuGeneral();
00150   TString filename=general.GetReleaseDirToUse("NtupleUtils");
00151   filename += "/NtupleUtils/data/pid_evans_cedar_daikon_LE185.root";
00152   fPDFFile = new
00153     TFile(filename, "READ");
00154 
00155   if(!fPDFFile || fPDFFile->IsZombie()){
00156     MSG("MajorityCurvature", Msg::kError) << "Required file is missing\n";
00157     exit(1);
00158   }
00159 
00160   fhMajCBa = dynamic_cast<TH1D*> (fPDFFile->Get("hMajCBa"));
00161   fhMajCBa->SetDirectory(0);
00162   if (!fhMajCBa){
00163     cout << "No MajCBa PDF. Expect a seg fault at any moment!" << endl;
00164   }
00165   fhMajCNC = dynamic_cast<TH1D*> (fPDFFile->Get("hMajCNC"));
00166   fhMajCNC->SetDirectory(0);
00167   if (!fhMajCNC){
00168     cout << "No MajCNC PDF. Expect a seg fault at any moment!" << endl;
00169   }
00170   fhMajCNu = dynamic_cast<TH1D*> (fPDFFile->Get("hMajCNu"));
00171   fhMajCNu->SetDirectory(0);
00172   if (!fhMajCNu){
00173     cout << "No MajCNu PDF. Expect a seg fault at any moment!" << endl;
00174   }
00175   fhQOverPBa = dynamic_cast<TH1D*> (fPDFFile->Get("hQOverPBa"));
00176   fhQOverPBa->SetDirectory(0);
00177   if (!fhQOverPBa){
00178     cout << "No QOverPBa PDF. Expect a seg fault at any moment!" << endl;
00179   }
00180   fhQOverPNC = dynamic_cast<TH1D*> (fPDFFile->Get("hQOverPNC"));
00181   fhQOverPNC->SetDirectory(0);
00182   if (!fhQOverPNC){
00183     cout << "No QOverPNC PDF. Expect a seg fault at any moment!" << endl;
00184   }
00185   fhQOverPNu = dynamic_cast<TH1D*> (fPDFFile->Get("hQOverPNu"));
00186   fhQOverPNu->SetDirectory(0);
00187   if (!fhQOverPNu){
00188     cout << "No QOverPNu PDF. Expect a seg fault at any moment!" << endl;
00189   }
00190   fPDFFile->Close();
00191 
00192   MSG("MajorityCurvature",Msg::kDebug)
00193     <<"TDirectory after using file is:"<<endl;
00194   //gDirectory->Print();
00195   MSG("MajorityCurvature",Msg::kDebug)
00196     <<"After reseting gDirectory its location is:"<<endl;
00197   gDirectory=tmpd;
00198   //gDirectory->Print();
00199   
00200   for (Int_t row=0; row<500; ++row){
00201     for (Int_t column=0; column<500; ++column){
00202       fitLengths[row][column] = 0;
00203     }
00204   }
00205    
00206   //Iteration 1
00207   fitLengths[0][0] = 0;
00208   fitLengths[1][0] = 0;
00209   fitLengths[2][0] = 0;
00210 
00211   for(Int_t tl=3; tl<8; ++tl){
00212     Int_t i=0;
00213     for(Int_t fl=tl; fl>1; --fl, ++i){
00214       fitLengths[tl][i] = fl;
00215       if (2==fl){fitLengths[tl][i] = 0;}
00216     }
00217   }
00218 
00219   for(Int_t tl=8; tl<11; ++tl){
00220     Int_t i=0;
00221     for(Int_t fl = 7; fl>3; --fl,++i){
00222       fitLengths[tl][i] = fl;
00223     }
00224     for(Int_t fl = 8; fl<=tl; ++fl,++i){
00225       fitLengths[tl][i] = fl;
00226     }
00227     fitLengths[tl][i] = 3;
00228     ++i;
00229     fitLengths[tl][i] = 0;
00230   }
00231 
00232   for (Int_t tl=11; tl<500; ++tl){
00233     fitLengths[tl][0] = 7;
00234     fitLengths[tl][1] = 8;
00235     fitLengths[tl][2] = 6;
00236     fitLengths[tl][3] = 5;
00237     fitLengths[tl][4] = 4;
00238     fitLengths[tl][5] = 0;
00239   }
00240   
00241   /*  
00242   //Iteration 2
00243   fitLengths[0][0] = 0;
00244   fitLengths[1][0] = 0;
00245   fitLengths[2][0] = 0;
00246 
00247   for(Int_t tl=3; tl<8; ++tl){
00248     Int_t i=0;
00249     for(Int_t fl=tl; fl>1; --fl, ++i){
00250       fitLengths[tl][i] = fl;
00251       if (2==fl){fitLengths[tl][i] = 0;}
00252     }
00253   }
00254 
00255   for (Int_t tl = 8; tl < 500; ++tl){
00256     Int_t i=0;
00257     for (Int_t fl = 7; fl <= tl; ++fl, ++i){
00258       fitLengths[tl][i] = fl;
00259     }
00260     ++i;
00261     for (Int_t fl=6; fl > 2; --fl, ++i){
00262       fitLengths[tl][i] = fl;
00263     }
00264     ++i;
00265     fitLengths[tl][i] = 0;
00266   }
00267   */
00268 }

MajorityCurvature::~MajorityCurvature (  )  [virtual]

Definition at line 271 of file MajorityCurvature.cxx.

References fhMajCBa, fhMajCNC, fhMajCNu, fhQOverPBa, fhQOverPNC, fhQOverPNu, and fPDFFile.

00272 {
00273   if (fhMajCBa) {delete fhMajCBa; fhMajCBa = 0;}
00274   if (fhMajCNu) {delete fhMajCNu; fhMajCNu = 0;}
00275   if (fhMajCNC) {delete fhMajCNC; fhMajCNC = 0;}
00276   if (fhQOverPBa) {delete fhQOverPBa; fhQOverPBa = 0;}
00277   if (fhQOverPNu) {delete fhQOverPNu; fhQOverPNu = 0;}
00278   if (fhQOverPNC) {delete fhQOverPNC; fhQOverPNC = 0;}
00279   fPDFFile->Close();
00280   if (fPDFFile) {delete fPDFFile; fPDFFile = 0;}
00281 }


Member Function Documentation

Float_t MajorityCurvature::CalcCombCurv ( const MomNavigator mom,
const Int_t  event,
const Int_t  track,
const Int_t  fitLength 
) const [private, virtual]

Definition at line 284 of file MajorityCurvature.cxx.

References SRMom::ArrayUAlongTrack(), SRMom::ArrayVAlongTrack(), and Munits::g.

Referenced by CurvatureComb().

00288 {
00289   //   if (snarl > 11){return JobCResult::kFailed;}
00290   SRMom srMom(mom);
00291   TH1F hCurv("hCurv","",100,-5,5);
00292 
00293   const multimap<Float_t, Float_t> mu
00294     = srMom.ArrayUAlongTrack(event,track);
00295   const Int_t sizeu = mu.size();
00296   Float_t* xerr = new Float_t[fitLength];
00297   Float_t* zerr = new Float_t[fitLength];
00298   Bool_t smallu = false;
00299 
00300   if (sizeu < fitLength){smallu = true;}
00301   else{
00302     multimap<Float_t,Float_t>::const_iterator itu = mu.begin();
00303     for (Int_t k=0; k<(sizeu-fitLength); ++k){
00304       Float_t* z = new Float_t[fitLength];
00305       Float_t* x = new Float_t[fitLength];
00306       Float_t* absx = new Float_t[fitLength];
00307       Bool_t changesign = false;
00308       Bool_t positive = false;
00309       if (itu->second > 0){positive = true;}
00310       for (Int_t l=0; l<fitLength; ++l)
00311         {
00312           Bool_t thispos = false;
00313           z[l] = itu->first;
00314           zerr[l] = 0.0594;
00315           x[l] = itu->second;
00316           xerr[l] = 0.041;
00317           absx[l] = fabs(itu->second);
00318           if (x[l] > 0){thispos = true;}
00319           if (thispos != positive){changesign = true;}
00320           ++itu;
00321         }
00322       if (!changesign){
00323         TGraphErrors g(fitLength,z,absx,zerr,xerr);
00324         //      TCanvas cd("cd","",0,0,500,500);
00325         g.Draw("A*");
00326         g.Fit("pol2","Q");
00327         //   cd.Print(Form("~/public_html/AASnarl%dEvent%dSegment%d.gif",snarl,event,k));
00328         Float_t curviness = 2*(g.GetFunction("pol2")->GetParameter(2));
00329         //       for (Double_t i = -99999999; i < 99999999; i+=0.1){
00330         //      Float_t j = 1; ++j;
00331         //       }
00332         hCurv.Fill(curviness);
00333       }
00334       for (Int_t l=0; l<fitLength; ++l)
00335         {
00336           --itu;
00337         }
00338       ++itu;
00339       if(z){delete z; z=0;}
00340       if(x){delete x; x=0;}
00341       if(absx){delete absx; absx=0;}
00342     }
00343   }
00344   
00345   const multimap<Float_t, Float_t> mv
00346     = srMom.ArrayVAlongTrack(event,track);
00347   const Int_t sizev = mv.size();
00348   if (sizev < fitLength){
00349     if (smallu){return 0.0;}
00350   }
00351   else{
00352     multimap<Float_t,Float_t>::const_iterator itv = mv.begin();
00353     for (Int_t k=0; k<(sizev-fitLength); ++k){
00354       Float_t* z = new Float_t[fitLength];
00355       Float_t* x = new Float_t[fitLength];
00356       Float_t* absx = new Float_t[fitLength];
00357       Bool_t changesign = false;
00358       Bool_t positive = false;
00359       if (itv->second > 0){positive = true;}
00360       for (Int_t l=0; l<fitLength; ++l)
00361         {
00362           Bool_t thispos = false;
00363           z[l] = itv->first;
00364           zerr[l] = 0.0594;
00365           x[l] = itv->second;
00366           xerr[l] = 0.041;
00367           absx[l] = fabs(itv->second);
00368           if (x[l] > 0){thispos = true;}
00369           if (thispos != positive){changesign = true;}
00370           ++itv;
00371         }
00372       if (!changesign){
00373         TGraphErrors g(fitLength,z,absx,zerr,xerr);
00374         //      TCanvas cd("cd","",0,0,500,500);
00375         g.Draw("A*");
00376         g.Fit("pol2","Q");
00377         //   cd.Print(Form("~/public_html/AASnarl%dEvent%dSegment%d.gif",snarl,event,k));
00378         Float_t curviness = 2*(g.GetFunction("pol2")->GetParameter(2));
00379         //       for (Double_t i = -99999999; i < 99999999; i+=0.1){
00380         //      Float_t j = 1; ++j;
00381         //       }
00382         hCurv.Fill(curviness);
00383       }
00384       for (Int_t l=0; l<fitLength; ++l)
00385         {
00386           --itv;
00387         }
00388       ++itv;
00389       if(z){delete z; z=0;}
00390       if(x){delete x; x=0;}
00391       if(absx){delete absx; absx=0;}
00392     }
00393   }
00394   TCanvas cCurv("cCurv","",0,0,500,500);
00395   hCurv.Draw();
00396   //   width = hCurv.GetRMS();
00397   //   cCurv.Print(Form("~/public_html/ASnarl%dEvent%d.gif",snarl,event));
00398   Float_t neg = hCurv.Integral(0,50);
00399   Float_t pos = hCurv.Integral(51,101);
00400   if(xerr){delete xerr; xerr = 0;}
00401   if(zerr){delete zerr; zerr = 0;}
00402   if (pos > neg) {if (neg) {return pos/neg;} else {return 10.0;}}
00403   if (neg > pos) {if (pos) {return -1.0*neg/pos;} else {return -10.0;}}
00404   if (neg == pos) {return 0.0;}
00405   return 0.0;
00406 }

virtual Float_t MajorityCurvature::CalcCurv ( const std::multimap< Float_t, Float_t >  md,
const Int_t  fitLength 
) const [private, virtual]

Referenced by CalcXCurv(), and CalcYCurv().

virtual MajCInfo MajorityCurvature::CalcCurvObject ( const std::multimap< Float_t, Float_t >  md,
const Int_t  fitLength 
) const [virtual]

Referenced by CalcXCurvObject(), and CalcYCurvObject().

virtual MajCInfo MajorityCurvature::CalcCurvObjectFast ( const std::multimap< Float_t, Float_t >  md,
const Int_t  fitLength 
) const [virtual]
Float_t MajorityCurvature::CalcXCurv ( const NtpSRTrack track,
const Int_t  fitLength 
) const [private, virtual]

Definition at line 787 of file MajorityCurvature.cxx.

References SRMom::ArrayXAlongTrack(), and CalcCurv().

00789 {
00790   SRMom srMom;
00791   const multimap<Float_t, Float_t> md
00792     = srMom.ArrayXAlongTrack(track);
00793   return CalcCurv(md, fitLength);
00794 }

Float_t MajorityCurvature::CalcXCurv ( const MomNavigator mom,
const Int_t  event,
const Int_t  track,
const Int_t  fitLength 
) const [private, virtual]

Definition at line 751 of file MajorityCurvature.cxx.

References SRMom::ArrayXAlongTrack(), and CalcCurv().

Referenced by XCurvature().

00755 {
00756   SRMom srMom(mom);
00757   const multimap<Float_t, Float_t> md
00758     = srMom.ArrayXAlongTrack(event,track);
00759   return CalcCurv(md, fitLength);
00760 }

MajCInfo MajorityCurvature::CalcXCurvObject ( const NtpSRTrack track,
const Int_t  fitLength 
) const [private, virtual]

Definition at line 777 of file MajorityCurvature.cxx.

References SRMom::ArrayXAlongTrack(), and CalcCurvObject().

00779 {
00780   SRMom srMom;
00781   const multimap<Float_t, Float_t> md
00782     = srMom.ArrayXAlongTrack(track);
00783   return CalcCurvObject(md, fitLength);
00784 }

MajCInfo MajorityCurvature::CalcXCurvObject ( const MomNavigator mom,
const Int_t  event,
const Int_t  track,
const Int_t  fitLength 
) const [private, virtual]

Definition at line 764 of file MajorityCurvature.cxx.

References SRMom::ArrayXAlongTrack(), and CalcCurvObject().

Referenced by XCurvatureObject().

00768 {
00769   SRMom srMom(mom);
00770   const multimap<Float_t, Float_t> md
00771     = srMom.ArrayXAlongTrack(event,track);
00772   return CalcCurvObject(md, fitLength);
00773 }

Float_t MajorityCurvature::CalcYCurv ( const NtpSRTrack track,
const Int_t  fitLength 
) const [private, virtual]

Definition at line 833 of file MajorityCurvature.cxx.

References SRMom::ArrayYAlongTrack(), and CalcCurv().

00835 {
00836   SRMom srMom;
00837   const multimap<Float_t, Float_t> md
00838     = srMom.ArrayYAlongTrack(track);
00839   return CalcCurv(md, fitLength);
00840 }

Float_t MajorityCurvature::CalcYCurv ( const MomNavigator mom,
const Int_t  event,
const Int_t  track,
const Int_t  fitLength 
) const [private, virtual]

Definition at line 797 of file MajorityCurvature.cxx.

References SRMom::ArrayYAlongTrack(), and CalcCurv().

Referenced by YCurvature().

00801 {
00802   SRMom srMom(mom);
00803   const multimap<Float_t, Float_t> md
00804     = srMom.ArrayYAlongTrack(event,track);
00805   return CalcCurv(md, fitLength);
00806 }

MajCInfo MajorityCurvature::CalcYCurvObject ( const NtpSRTrack track,
const Int_t  fitLength 
) const [private, virtual]

Definition at line 823 of file MajorityCurvature.cxx.

References SRMom::ArrayYAlongTrack(), and CalcCurvObject().

00825 {
00826   SRMom srMom;
00827   const multimap<Float_t, Float_t> md
00828     = srMom.ArrayYAlongTrack(track);
00829   return CalcCurvObject(md, fitLength);
00830 }

MajCInfo MajorityCurvature::CalcYCurvObject ( const MomNavigator mom,
const Int_t  event,
const Int_t  track,
const Int_t  fitLength 
) const [private, virtual]

Definition at line 810 of file MajorityCurvature.cxx.

References SRMom::ArrayYAlongTrack(), and CalcCurvObject().

Referenced by YCurvatureObject().

00814 {
00815   SRMom srMom(mom);
00816   const multimap<Float_t, Float_t> md
00817     = srMom.ArrayYAlongTrack(event,track);
00818   return CalcCurvObject(md, fitLength);
00819 }

Float_t MajorityCurvature::Curvature ( const NtpSRTrack track  )  const [virtual]

Definition at line 843 of file MajorityCurvature.cxx.

References XCurvature(), and YCurvature().

00844 {
00845   Float_t xCurv = XCurvature(track);
00846   Float_t yCurv = YCurvature(track);
00847   if (fabs(yCurv) > fabs(xCurv)){return yCurv;}
00848   else {return xCurv;}
00849 }

Float_t MajorityCurvature::Curvature ( const MomNavigator mom,
const Int_t  event,
const Int_t  track 
) const [virtual]

Definition at line 884 of file MajorityCurvature.cxx.

References XCurvature(), and YCurvature().

00887 {
00888   Float_t xCurv = XCurvature(mom,event,track);
00889   Float_t yCurv = YCurvature(mom,event,track);
00890   if (fabs(yCurv) > fabs(xCurv)){return yCurv;}
00891   else {return xCurv;}
00892 }

Float_t MajorityCurvature::CurvatureComb ( const MomNavigator mom,
const Int_t  event,
const Int_t  track 
) const [virtual]

Definition at line 895 of file MajorityCurvature.cxx.

References CalcCombCurv(), FitLength(), NextFitLength(), and SRMom::TrackLengthPlanes().

00898 {
00899   SRMom srMom(mom);
00900   const Int_t trkLthPln = srMom.TrackLengthPlanes(event,track);
00901   Int_t fitLength = FitLength(trkLthPln);
00902   if (!fitLength) {return 0.0;}
00903   Float_t xCurv = CalcCombCurv(mom,event,track,fitLength);
00904   if (xCurv) {return xCurv;}
00905   while (!xCurv){
00906     fitLength = NextFitLength(trkLthPln,fitLength);
00907     if (!fitLength){return 0.0;}
00908     xCurv = CalcCombCurv(mom,event,track,fitLength);
00909   }
00910   return xCurv;
00911 }

MajCInfo MajorityCurvature::CurvatureImproved ( const MomNavigator mom,
const Int_t  event,
const Int_t  track 
) const [virtual]

Definition at line 868 of file MajorityCurvature.cxx.

References JPID(), MajCInfo::jPID, MajCInfo::majC, SRMom::TrackVtxQOvP(), XCurvatureObject(), and YCurvatureObject().

00871 {
00872   MajCInfo xCurv = XCurvatureObject(mom,event,track);
00873   MajCInfo yCurv = YCurvatureObject(mom,event,track);
00874   MajCInfo* bestCurv;
00875   if (fabs(yCurv.majC) > fabs(xCurv.majC)){bestCurv = &yCurv;}
00876   else {bestCurv = &xCurv;}
00877   SRMom srMom(mom);
00878   Double_t qp = srMom.TrackVtxQOvP(event,track);
00879   bestCurv->jPID = this->JPID(qp,bestCurv->majC);
00880   return *bestCurv;
00881 }

MajCInfo MajorityCurvature::CurvatureImproved ( const NtpSRTrack track  )  const [virtual]

Definition at line 853 of file MajorityCurvature.cxx.

References JPID(), MajCInfo::jPID, MajCInfo::majC, SRMom::TrackVtxQOvP(), XCurvatureObject(), and YCurvatureObject().

Referenced by NuExtraction::ExtractMajorityCurvature().

00854 {
00855   MajCInfo xCurv = XCurvatureObject(track);
00856   MajCInfo yCurv = YCurvatureObject(track);
00857   MajCInfo* bestCurv;
00858   if (fabs(yCurv.majC) > fabs(xCurv.majC)){bestCurv = &yCurv;}
00859   else {bestCurv = &xCurv;}
00860   SRMom srMom;
00861   Double_t qp = srMom.TrackVtxQOvP(track);
00862   bestCurv->jPID = this->JPID(qp,bestCurv->majC);
00863   return *bestCurv;
00864 }

Int_t MajorityCurvature::FitLength ( const Int_t  trkLthPln  )  const [virtual]

Definition at line 914 of file MajorityCurvature.cxx.

References fitLengths.

Referenced by CurvatureComb(), XCurvature(), XCurvatureObject(), YCurvature(), and YCurvatureObject().

00915 {
00916   return fitLengths[trkLthPln][0];
00917 }

Double_t MajorityCurvature::JPID ( const Double_t  qOverP,
const Double_t  majC 
) const [virtual]

Definition at line 920 of file MajorityCurvature.cxx.

References fhMajCBa, fhMajCNC, fhMajCNu, fhQOverPBa, fhQOverPNC, and fhQOverPNu.

Referenced by CurvatureImproved().

00922 {
00923   Double_t pBackMajC =
00924     fhMajCNu->GetBinContent(fhMajCNu->GetXaxis()->FindBin(majC));
00925   pBackMajC +=
00926     fhMajCNC->GetBinContent(fhMajCNC->GetXaxis()->FindBin(majC));
00927   Double_t pSigMajC =
00928     fhMajCBa->GetBinContent(fhMajCBa->GetXaxis()->FindBin(majC));
00929 
00930   Double_t pBackqOvp =
00931     fhQOverPNu->GetBinContent(fhQOverPNu->GetXaxis()->FindBin(qOverP));
00932   pBackqOvp +=
00933     fhQOverPNC->GetBinContent(fhQOverPNC->GetXaxis()->FindBin(qOverP));
00934   Double_t pSigqOvp =
00935     fhQOverPBa->GetBinContent(fhQOverPBa->GetXaxis()->FindBin(qOverP));
00936 
00937   Float_t numerator =
00938     pBackMajC*pBackqOvp;
00939   if (numerator<0.0001){numerator = 0.0001;}
00940   Float_t denominator =
00941     pSigMajC*pSigqOvp;
00942   if (denominator<0.0001){denominator = 0.0001;}
00943   
00944   Double_t jPID = log(numerator/denominator);
00945   return jPID;
00946 }

Int_t MajorityCurvature::NextFitLength ( const Int_t  trkLthPln,
const Int_t  lastFitLength 
) const [virtual]

Definition at line 949 of file MajorityCurvature.cxx.

References fitLengths.

Referenced by CurvatureComb(), XCurvature(), XCurvatureObject(), YCurvature(), and YCurvatureObject().

00952 {
00953   Int_t i=0;
00954   Int_t fitLength = 0;
00955   for (i=0; fitLength != lastFitLength; ++i){
00956     fitLength = fitLengths[trkLthPln][i];
00957     if (!fitLength){return fitLength;}
00958   }
00959   return fitLengths[trkLthPln][i];
00960 }

Float_t MajorityCurvature::XCurvature ( const NtpSRTrack track  )  const [virtual]

Definition at line 1020 of file MajorityCurvature.cxx.

References CalcXCurv(), FitLength(), NextFitLength(), and SRMom::TrackLengthPlanes().

01022 {
01023   SRMom srMom;
01024   const Int_t trkLthPln = srMom.TrackLengthPlanes(track);
01025   Int_t fitLength = FitLength(trkLthPln);
01026   if (!fitLength) {return 0.0;}
01027   Float_t xCurv = CalcXCurv(track,fitLength);
01028   if (xCurv) {return xCurv;}
01029   while (!xCurv){
01030     fitLength = NextFitLength(trkLthPln,fitLength);
01031     if (!fitLength){return 0.0;}
01032     xCurv = CalcXCurv(track,fitLength);
01033   }
01034   return xCurv;
01035 }

Float_t MajorityCurvature::XCurvature ( const MomNavigator mom,
const Int_t  event,
const Int_t  track 
) const [virtual]

Definition at line 963 of file MajorityCurvature.cxx.

References CalcXCurv(), FitLength(), NextFitLength(), and SRMom::TrackLengthPlanes().

Referenced by Curvature().

00966 {
00967   SRMom srMom(mom);
00968   const Int_t trkLthPln = srMom.TrackLengthPlanes(event,track);
00969   Int_t fitLength = FitLength(trkLthPln);
00970   if (!fitLength) {return 0.0;}
00971   Float_t xCurv = CalcXCurv(mom,event,track,fitLength);
00972   if (xCurv) {return xCurv;}
00973   while (!xCurv){
00974     fitLength = NextFitLength(trkLthPln,fitLength);
00975     if (!fitLength){return 0.0;}
00976     xCurv = CalcXCurv(mom,event,track,fitLength);
00977   }
00978   return xCurv;
00979 }

MajCInfo MajorityCurvature::XCurvatureObject ( const NtpSRTrack track  )  const [virtual]

Definition at line 1003 of file MajorityCurvature.cxx.

References CalcXCurvObject(), FitLength(), MajCInfo::majC, NextFitLength(), and SRMom::TrackLengthPlanes().

01004 {
01005   SRMom srMom;
01006   const Int_t trkLthPln = srMom.TrackLengthPlanes(track);
01007   Int_t fitLength = FitLength(trkLthPln);
01008   if (!fitLength) {MajCInfo empty; return empty;}
01009   MajCInfo xCurv = CalcXCurvObject(track,fitLength);
01010   if (xCurv.majC) {return xCurv;}
01011   while (!xCurv.majC){
01012     fitLength = NextFitLength(trkLthPln,fitLength);
01013     if (!fitLength){MajCInfo empty; return empty;}
01014     xCurv = CalcXCurvObject(track,fitLength);
01015   }
01016   return xCurv;
01017 }

MajCInfo MajorityCurvature::XCurvatureObject ( const MomNavigator mom,
const Int_t  event,
const Int_t  track 
) const [virtual]

Definition at line 983 of file MajorityCurvature.cxx.

References CalcXCurvObject(), FitLength(), MajCInfo::majC, NextFitLength(), and SRMom::TrackLengthPlanes().

Referenced by CurvatureImproved().

00986 {
00987   SRMom srMom(mom);
00988   const Int_t trkLthPln = srMom.TrackLengthPlanes(event,track);
00989   Int_t fitLength = FitLength(trkLthPln);
00990   if (!fitLength) {MajCInfo empty; return empty;}
00991   MajCInfo xCurv = CalcXCurvObject(mom,event,track,fitLength);
00992   if (xCurv.majC) {return xCurv;}
00993   while (!xCurv.majC){
00994     fitLength = NextFitLength(trkLthPln,fitLength);
00995     if (!fitLength){MajCInfo empty; return empty;}
00996     xCurv = CalcXCurvObject(mom,event,track,fitLength);
00997   }
00998   return xCurv;
00999 }

Float_t MajorityCurvature::YCurvature ( const NtpSRTrack track  )  const [virtual]

Definition at line 1095 of file MajorityCurvature.cxx.

References CalcYCurv(), FitLength(), NextFitLength(), and SRMom::TrackLengthPlanes().

01096 {
01097   SRMom srMom;
01098   const Int_t trkLthPln = srMom.TrackLengthPlanes(track);
01099   Int_t fitLength = FitLength(trkLthPln);
01100   if (!fitLength) {return 0.0;}
01101   Float_t yCurv = CalcYCurv(track,fitLength);
01102   if (yCurv) {return yCurv;}
01103   while (!yCurv){
01104     fitLength = NextFitLength(trkLthPln,fitLength);
01105     if (!fitLength){return 0.0;}
01106     yCurv = CalcYCurv(track,fitLength);
01107   }
01108   return yCurv;
01109 }

Float_t MajorityCurvature::YCurvature ( const MomNavigator mom,
const Int_t  event,
const Int_t  track 
) const [virtual]

Definition at line 1038 of file MajorityCurvature.cxx.

References CalcYCurv(), FitLength(), NextFitLength(), and SRMom::TrackLengthPlanes().

Referenced by Curvature().

01041 {
01042   SRMom srMom(mom);
01043   const Int_t trkLthPln = srMom.TrackLengthPlanes(event,track);
01044   Int_t fitLength = FitLength(trkLthPln);
01045   if (!fitLength) {return 0.0;}
01046   Float_t yCurv = CalcYCurv(mom,event,track,fitLength);
01047   if (yCurv) {return yCurv;}
01048   while (!yCurv){
01049     fitLength = NextFitLength(trkLthPln,fitLength);
01050     if (!fitLength){return 0.0;}
01051     yCurv = CalcYCurv(mom,event,track,fitLength);
01052   }
01053   return yCurv;
01054 }

MajCInfo MajorityCurvature::YCurvatureObject ( const NtpSRTrack track  )  const [virtual]

Definition at line 1078 of file MajorityCurvature.cxx.

References CalcYCurvObject(), FitLength(), MajCInfo::majC, NextFitLength(), and SRMom::TrackLengthPlanes().

01079 {
01080   SRMom srMom;
01081   const Int_t trkLthPln = srMom.TrackLengthPlanes(track);
01082   Int_t fitLength = FitLength(trkLthPln);
01083   if (!fitLength) {MajCInfo empty; return empty;}
01084   MajCInfo yCurv = CalcYCurvObject(track,fitLength);
01085   if (yCurv.majC) {return yCurv;}
01086   while (!yCurv.majC){
01087     fitLength = NextFitLength(trkLthPln,fitLength);
01088     if (!fitLength){MajCInfo empty; return empty;}
01089     yCurv = CalcYCurvObject(track,fitLength);
01090   }
01091   return yCurv;
01092 }

MajCInfo MajorityCurvature::YCurvatureObject ( const MomNavigator mom,
const Int_t  event,
const Int_t  track 
) const [virtual]

Definition at line 1058 of file MajorityCurvature.cxx.

References CalcYCurvObject(), FitLength(), MajCInfo::majC, NextFitLength(), and SRMom::TrackLengthPlanes().

Referenced by CurvatureImproved().

01061 {
01062   SRMom srMom(mom);
01063   const Int_t trkLthPln = srMom.TrackLengthPlanes(event,track);
01064   Int_t fitLength = FitLength(trkLthPln);
01065   if (!fitLength) {MajCInfo empty; return empty;}
01066   MajCInfo yCurv = CalcYCurvObject(mom,event,track,fitLength);
01067   if (yCurv.majC) {return yCurv;}
01068   while (!yCurv.majC){
01069     fitLength = NextFitLength(trkLthPln,fitLength);
01070     if (!fitLength){MajCInfo empty; return empty;}
01071     yCurv = CalcYCurvObject(mom,event,track,fitLength);
01072   }
01073   return yCurv;
01074 }


Member Data Documentation

TH1D* MajorityCurvature::fhMajCBa [private]

Definition at line 122 of file MajorityCurvature.h.

Referenced by JPID(), and ~MajorityCurvature().

TH1D* MajorityCurvature::fhMajCNC [private]

Definition at line 123 of file MajorityCurvature.h.

Referenced by JPID(), and ~MajorityCurvature().

TH1D* MajorityCurvature::fhMajCNu [private]

Definition at line 124 of file MajorityCurvature.h.

Referenced by JPID(), and ~MajorityCurvature().

Definition at line 125 of file MajorityCurvature.h.

Referenced by JPID(), and ~MajorityCurvature().

Definition at line 126 of file MajorityCurvature.h.

Referenced by JPID(), and ~MajorityCurvature().

Definition at line 127 of file MajorityCurvature.h.

Referenced by JPID(), and ~MajorityCurvature().

Int_t MajorityCurvature::fitLengths[500][500] [private]

Definition at line 160 of file MajorityCurvature.h.

Referenced by FitLength(), and NextFitLength().

TFile* MajorityCurvature::fPDFFile [private]

Definition at line 128 of file MajorityCurvature.h.

Referenced by ~MajorityCurvature().

TH1F * MajorityCurvature::hvariances = new TH1F("hvariances","",200,-5,5) [static]

Definition at line 119 of file MajorityCurvature.h.


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1