#include <MajorityCurvature.h>
Public Member Functions | |
| MajorityCurvature () | |
| virtual | ~MajorityCurvature () |
| virtual const MajCInfo | CalcCurvObject (const std::multimap< Float_t, Float_t > md, const Int_t fitLength) const |
| virtual const MajCInfo | CalcCurvObjectFast (const std::multimap< Float_t, Float_t > md, const Int_t fitLength) const |
| virtual const Float_t | Curvature (const MomNavigator *mom, const Int_t event, const Int_t track) const |
| virtual const MajCInfo | CurvatureImproved (const NtpSRTrack *track) const |
| virtual const MajCInfo | CurvatureImproved (const MomNavigator *mom, const Int_t event, const Int_t track) const |
| virtual const Float_t | Curvature (const NtpSRTrack *track) const |
| virtual const Float_t | CurvatureComb (const MomNavigator *mom, const Int_t event, const Int_t track) const |
| virtual const Int_t | FitLength (const Int_t trkLthPln) const |
| virtual const Double_t | JPID (const Double_t qOverP, const Double_t majC) const |
| virtual const Int_t | NextFitLength (const Int_t trkLthPln, const Int_t lastFitLength) const |
| virtual const Float_t | XCurvature (const MomNavigator *mom, const Int_t event, const Int_t track) const |
| virtual const MajCInfo | XCurvatureObject (const MomNavigator *mom, const Int_t event, const Int_t track) const |
| virtual const MajCInfo | XCurvatureObject (const NtpSRTrack *track) const |
| virtual const Float_t | XCurvature (const NtpSRTrack *track) const |
| virtual const Float_t | YCurvature (const MomNavigator *mom, const Int_t event, const Int_t track) const |
| virtual const MajCInfo | YCurvatureObject (const MomNavigator *mom, const Int_t event, const Int_t track) const |
| virtual const MajCInfo | YCurvatureObject (const NtpSRTrack *track) const |
| virtual const Float_t | YCurvature (const NtpSRTrack *track) const |
Static Public Attributes | |
| TH1F * | hvariances = new TH1F("hvariances","",200,-5,5) |
Private Member Functions | |
| virtual const Float_t | CalcCombCurv (const MomNavigator *mom, const Int_t event, const Int_t track, const Int_t fitLength) const |
| virtual const Float_t | CalcCurv (const std::multimap< Float_t, Float_t > md, const Int_t fitLength) const |
| virtual const Float_t | CalcXCurv (const MomNavigator *mom, const Int_t event, const Int_t track, const Int_t fitLength) const |
| virtual const MajCInfo | CalcXCurvObject (const MomNavigator *mom, const Int_t event, const Int_t track, const Int_t fitLength) const |
| virtual const MajCInfo | CalcXCurvObject (const NtpSRTrack *track, const Int_t fitLength) const |
| virtual const Float_t | CalcXCurv (const NtpSRTrack *track, const Int_t fitLength) const |
| virtual const Float_t | CalcYCurv (const MomNavigator *mom, const Int_t event, const Int_t track, const Int_t fitLength) const |
| virtual const MajCInfo | CalcYCurvObject (const MomNavigator *mom, const Int_t event, const Int_t track, const Int_t fitLength) const |
| virtual const MajCInfo | CalcYCurvObject (const NtpSRTrack *track, const Int_t fitLength) const |
| virtual const 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] |
|
|
Definition at line 112 of file MajorityCurvature.cxx. References NuGeneral::GetReleaseDirToUse(), and MSG. 00113 {
00114
00115 // topDir="MCReweight/data";
00116 // std::string base="";
00117 // base=getenv("SRT_PRIVATE_CONTEXT");
00118 // if(base=="" || base==".") base=getenv("SRT_PUBLIC_CONTEXT");
00119 // if(base=="") {
00120 // cout<<"No SRT_PUBLIC_CONTEXT set"<<std::endl;
00121 // assert(false);
00122 // }
00123 // topDir = base+ "/" + topDir;
00124
00125
00126 TDirectory* tmpd = gDirectory;
00127 MSG("MajorityCurvature",Msg::kDebug)
00128 <<"TDirectory before opening file is:"<<endl;
00129 //tmpd->Print();
00130
00131 const NuGeneral& general=NuGeneral();
00132 TString filename=general.GetReleaseDirToUse("NtupleUtils");
00133 filename += "/NtupleUtils/data/pid_evans_cedar_daikon_LE185.root";
00134 fPDFFile = new
00135 TFile(filename, "READ");
00136
00137 fhMajCBa = dynamic_cast<TH1D*> (fPDFFile->Get("hMajCBa"));
00138 fhMajCBa->SetDirectory(0);
00139 if (!fhMajCBa){
00140 cout << "No MajCBa PDF. Expect a seg fault at any moment!" << endl;
00141 }
00142 fhMajCNC = dynamic_cast<TH1D*> (fPDFFile->Get("hMajCNC"));
00143 fhMajCNC->SetDirectory(0);
00144 if (!fhMajCNC){
00145 cout << "No MajCNC PDF. Expect a seg fault at any moment!" << endl;
00146 }
00147 fhMajCNu = dynamic_cast<TH1D*> (fPDFFile->Get("hMajCNu"));
00148 fhMajCNu->SetDirectory(0);
00149 if (!fhMajCNu){
00150 cout << "No MajCNu PDF. Expect a seg fault at any moment!" << endl;
00151 }
00152 fhQOverPBa = dynamic_cast<TH1D*> (fPDFFile->Get("hQOverPBa"));
00153 fhQOverPBa->SetDirectory(0);
00154 if (!fhQOverPBa){
00155 cout << "No QOverPBa PDF. Expect a seg fault at any moment!" << endl;
00156 }
00157 fhQOverPNC = dynamic_cast<TH1D*> (fPDFFile->Get("hQOverPNC"));
00158 fhQOverPNC->SetDirectory(0);
00159 if (!fhQOverPNC){
00160 cout << "No QOverPNC PDF. Expect a seg fault at any moment!" << endl;
00161 }
00162 fhQOverPNu = dynamic_cast<TH1D*> (fPDFFile->Get("hQOverPNu"));
00163 fhQOverPNu->SetDirectory(0);
00164 if (!fhQOverPNu){
00165 cout << "No QOverPNu PDF. Expect a seg fault at any moment!" << endl;
00166 }
00167 fPDFFile->Close();
00168
00169 MSG("MajorityCurvature",Msg::kDebug)
00170 <<"TDirectory after using file is:"<<endl;
00171 //gDirectory->Print();
00172 MSG("MajorityCurvature",Msg::kDebug)
00173 <<"After reseting gDirectory its location is:"<<endl;
00174 gDirectory=tmpd;
00175 //gDirectory->Print();
00176
00177 for (Int_t row=0; row<500; ++row){
00178 for (Int_t column=0; column<500; ++column){
00179 fitLengths[row][column] = 0;
00180 }
00181 }
00182
00183 //Iteration 1
00184 fitLengths[0][0] = 0;
00185 fitLengths[1][0] = 0;
00186 fitLengths[2][0] = 0;
00187
00188 for(Int_t tl=3; tl<8; ++tl){
00189 Int_t i=0;
00190 for(Int_t fl=tl; fl>1; --fl, ++i){
00191 fitLengths[tl][i] = fl;
00192 if (2==fl){fitLengths[tl][i] = 0;}
00193 }
00194 }
00195
00196 for(Int_t tl=8; tl<11; ++tl){
00197 Int_t i=0;
00198 for(Int_t fl = 7; fl>3; --fl,++i){
00199 fitLengths[tl][i] = fl;
00200 }
00201 for(Int_t fl = 8; fl<=tl; ++fl,++i){
00202 fitLengths[tl][i] = fl;
00203 }
00204 fitLengths[tl][i] = 3;
00205 ++i;
00206 fitLengths[tl][i] = 0;
00207 }
00208
00209 for (Int_t tl=11; tl<500; ++tl){
00210 fitLengths[tl][0] = 7;
00211 fitLengths[tl][1] = 8;
00212 fitLengths[tl][2] = 6;
00213 fitLengths[tl][3] = 5;
00214 fitLengths[tl][4] = 4;
00215 fitLengths[tl][5] = 0;
00216 }
00217
00218 /*
00219 //Iteration 2
00220 fitLengths[0][0] = 0;
00221 fitLengths[1][0] = 0;
00222 fitLengths[2][0] = 0;
00223
00224 for(Int_t tl=3; tl<8; ++tl){
00225 Int_t i=0;
00226 for(Int_t fl=tl; fl>1; --fl, ++i){
00227 fitLengths[tl][i] = fl;
00228 if (2==fl){fitLengths[tl][i] = 0;}
00229 }
00230 }
00231
00232 for (Int_t tl = 8; tl < 500; ++tl){
00233 Int_t i=0;
00234 for (Int_t fl = 7; fl <= tl; ++fl, ++i){
00235 fitLengths[tl][i] = fl;
00236 }
00237 ++i;
00238 for (Int_t fl=6; fl > 2; --fl, ++i){
00239 fitLengths[tl][i] = fl;
00240 }
00241 ++i;
00242 fitLengths[tl][i] = 0;
00243 }
00244 */
00245 }
|
|
|
Definition at line 248 of file MajorityCurvature.cxx. References fhMajCBa, fhMajCNC, fhMajCNu, fhQOverPBa, fhQOverPNC, fhQOverPNu, and fPDFFile. 00249 {
00250 if (fhMajCBa) {delete fhMajCBa; fhMajCBa = 0;}
00251 if (fhMajCNu) {delete fhMajCNu; fhMajCNu = 0;}
00252 if (fhMajCNC) {delete fhMajCNC; fhMajCNC = 0;}
00253 if (fhQOverPBa) {delete fhQOverPBa; fhQOverPBa = 0;}
00254 if (fhQOverPNu) {delete fhQOverPNu; fhQOverPNu = 0;}
00255 if (fhQOverPNC) {delete fhQOverPNC; fhQOverPNC = 0;}
00256 fPDFFile->Close();
00257 if (fPDFFile) {delete fPDFFile; fPDFFile = 0;}
00258 }
|
|
||||||||||||||||||||
|
Definition at line 261 of file MajorityCurvature.cxx. References SRMom::ArrayUAlongTrack(), SRMom::ArrayVAlongTrack(), and Munits::g. Referenced by CurvatureComb(). 00265 {
00266 // if (snarl > 11){return JobCResult::kFailed;}
00267 SRMom srMom(mom);
00268 TH1F hCurv("hCurv","",100,-5,5);
00269
00270 const multimap<Float_t, Float_t> mu
00271 = srMom.ArrayUAlongTrack(event,track);
00272 const Int_t sizeu = mu.size();
00273 Float_t* xerr = new Float_t[fitLength];
00274 Float_t* zerr = new Float_t[fitLength];
00275 Bool_t smallu = false;
00276
00277 if (sizeu < fitLength){smallu = true;}
00278 else{
00279 multimap<Float_t,Float_t>::const_iterator itu = mu.begin();
00280 for (Int_t k=0; k<(sizeu-fitLength); ++k){
00281 Float_t* z = new Float_t[fitLength];
00282 Float_t* x = new Float_t[fitLength];
00283 Float_t* absx = new Float_t[fitLength];
00284 Bool_t changesign = false;
00285 Bool_t positive = false;
00286 if (itu->second > 0){positive = true;}
00287 for (Int_t l=0; l<fitLength; ++l)
00288 {
00289 Bool_t thispos = false;
00290 z[l] = itu->first;
00291 zerr[l] = 0.0594;
00292 x[l] = itu->second;
00293 xerr[l] = 0.041;
00294 absx[l] = fabs(itu->second);
00295 if (x[l] > 0){thispos = true;}
00296 if (thispos != positive){changesign = true;}
00297 ++itu;
00298 }
00299 if (!changesign){
00300 TGraphErrors g(fitLength,z,absx,zerr,xerr);
00301 // TCanvas cd("cd","",0,0,500,500);
00302 g.Draw("A*");
00303 g.Fit("pol2","Q");
00304 // cd.Print(Form("~/public_html/AASnarl%dEvent%dSegment%d.gif",snarl,event,k));
00305 Float_t curviness = 2*(g.GetFunction("pol2")->GetParameter(2));
00306 // for (Double_t i = -99999999; i < 99999999; i+=0.1){
00307 // Float_t j = 1; ++j;
00308 // }
00309 hCurv.Fill(curviness);
00310 }
00311 for (Int_t l=0; l<fitLength; ++l)
00312 {
00313 --itu;
00314 }
00315 ++itu;
00316 if(z){delete z; z=0;}
00317 if(x){delete x; x=0;}
00318 if(absx){delete absx; absx=0;}
00319 }
00320 }
00321
00322 const multimap<Float_t, Float_t> mv
00323 = srMom.ArrayVAlongTrack(event,track);
00324 const Int_t sizev = mv.size();
00325 if (sizev < fitLength){
00326 if (smallu){return 0.0;}
00327 }
00328 else{
00329 multimap<Float_t,Float_t>::const_iterator itv = mv.begin();
00330 for (Int_t k=0; k<(sizev-fitLength); ++k){
00331 Float_t* z = new Float_t[fitLength];
00332 Float_t* x = new Float_t[fitLength];
00333 Float_t* absx = new Float_t[fitLength];
00334 Bool_t changesign = false;
00335 Bool_t positive = false;
00336 if (itv->second > 0){positive = true;}
00337 for (Int_t l=0; l<fitLength; ++l)
00338 {
00339 Bool_t thispos = false;
00340 z[l] = itv->first;
00341 zerr[l] = 0.0594;
00342 x[l] = itv->second;
00343 xerr[l] = 0.041;
00344 absx[l] = fabs(itv->second);
00345 if (x[l] > 0){thispos = true;}
00346 if (thispos != positive){changesign = true;}
00347 ++itv;
00348 }
00349 if (!changesign){
00350 TGraphErrors g(fitLength,z,absx,zerr,xerr);
00351 // TCanvas cd("cd","",0,0,500,500);
00352 g.Draw("A*");
00353 g.Fit("pol2","Q");
00354 // cd.Print(Form("~/public_html/AASnarl%dEvent%dSegment%d.gif",snarl,event,k));
00355 Float_t curviness = 2*(g.GetFunction("pol2")->GetParameter(2));
00356 // for (Double_t i = -99999999; i < 99999999; i+=0.1){
00357 // Float_t j = 1; ++j;
00358 // }
00359 hCurv.Fill(curviness);
00360 }
00361 for (Int_t l=0; l<fitLength; ++l)
00362 {
00363 --itv;
00364 }
00365 ++itv;
00366 if(z){delete z; z=0;}
00367 if(x){delete x; x=0;}
00368 if(absx){delete absx; absx=0;}
00369 }
00370 }
00371 TCanvas cCurv("cCurv","",0,0,500,500);
00372 hCurv.Draw();
00373 // width = hCurv.GetRMS();
00374 // cCurv.Print(Form("~/public_html/ASnarl%dEvent%d.gif",snarl,event));
00375 Float_t neg = hCurv.Integral(0,50);
00376 Float_t pos = hCurv.Integral(51,101);
00377 if(xerr){delete xerr; xerr = 0;}
00378 if(zerr){delete zerr; zerr = 0;}
00379 if (pos > neg) {if (neg) {return pos/neg;} else {return 10.0;}}
00380 if (neg > pos) {if (pos) {return -1.0*neg/pos;} else {return -10.0;}}
00381 if (neg == pos) {return 0.0;}
00382 return 0.0;
00383 }
|
|
||||||||||||
|
Definition at line 386 of file MajorityCurvature.cxx. References Munits::g, and hvariances. Referenced by CalcXCurv(), and CalcYCurv(). 00389 {
00390 //Set up some arrays.
00391 const Int_t size = md.size();
00392 Float_t* xerr = new Float_t[fitLength];
00393 Float_t* zerr = new Float_t[fitLength];
00394 if (size<fitLength){return 0.0;}
00395
00396 multimap<Float_t, Float_t> mfits; //<abs(parabolic fit),(parabolic fit)>
00397 multimap<Float_t,Float_t>::const_iterator it = md.begin();
00398 //k loops over the fit segments.
00399 for (Int_t k=0; k<(size-fitLength); ++k){
00400 Float_t* z = new Float_t[fitLength];
00401 Float_t* x = new Float_t[fitLength];
00402 Float_t* absx = new Float_t[fitLength];
00403 Bool_t changesign = false;
00404 Bool_t positive = false;
00405 if (it->second > 0){positive = true;}
00406 //l loops over the strips in each fit segment
00407 //The variable 'positive' says whether the first strip in a
00408 //segment has a positive co-ordinate.
00409 for (Int_t l=0; l<fitLength; ++l)
00410 {
00411 Bool_t thispos = false;
00412 z[l] = it->first;
00413 zerr[l] = 0.0594;
00414 x[l] = it->second;
00415 xerr[l] = 0.041;
00416 absx[l] = fabs(it->second);
00417 if (x[l] > 0){thispos = true;}
00418 if (thispos != positive){changesign = true;}
00419 ++it;
00420 }
00421 if (!changesign){
00422 TGraphErrors g(fitLength,z,absx,zerr,xerr);
00423 // TCanvas cd("cd","",0,0,500,500);
00424 g.Draw("A*");
00425 g.Fit("pol2","Q");
00426 Float_t curviness = 2*(g.GetFunction("pol2")->GetParameter(2));
00427 // hCurv.Fill(curviness);
00428 mfits.insert(pair<Float_t,Float_t>(fabs(curviness),
00429 curviness));
00430 }
00431 for (Int_t l=0; l<fitLength; ++l)
00432 {
00433 --it;
00434 }
00435 ++it;
00436 if(z){delete z; z=0;}
00437 if(x){delete x; x=0;}
00438 if(absx){delete absx; absx=0;}
00439 }
00440
00441 multimap<Float_t,Float_t>::const_iterator itfits = mfits.end();
00442 Int_t numRemove = 0;
00443 if (((Int_t) mfits.size()) >= numRemove){
00444 for (Int_t rem = 0; rem < numRemove; ++rem){
00445 itfits--;
00446 mfits.erase(itfits->first);
00447 itfits = mfits.end();
00448 }
00449 }
00450 TH1F hCurv("hCurv","",100,-5,5);
00451 for (itfits = mfits.begin();
00452 itfits != mfits.end();
00453 ++itfits){
00454 hCurv.Fill(itfits->second);
00455 }
00456
00457 TCanvas cCurv("cCurv","",0,0,500,500);
00458 hCurv.Draw();
00459 // width = hCurv.GetRMS();
00460 // cCurv.Print(Form("~/public_html/ASnarl%dEvent%d.gif",snarl,event));
00461 Float_t neg = hCurv.Integral(0,50);
00462 Float_t pos = hCurv.Integral(51,101);
00463 hvariances->Fill(hCurv.GetRMS());
00464 // flastVariance = hCurv.GetRMS();
00465 if (pos > neg) {if (neg) {return pos/neg;} else {return 10.0;}}
00466 if (neg > pos) {if (pos) {return -1.0*neg/pos;} else {return -10.0;}}
00467 if (neg == pos) {return 0.0;}
00468 else {return 0.0;}
00469 }
|
|
||||||||||||
|
Definition at line 472 of file MajorityCurvature.cxx. References hvariances, MajCInfo::jitter, MajCInfo::majC, MajCInfo::majCRatio, MajCInfo::rms, MajCInfo::simpleMajC, MajCInfo::smoothMajC, MajCInfo::sqJitter, and MajCInfo::totWidth. Referenced by CalcXCurvObject(), and CalcYCurvObject(). 00476 {
00477 //Object to return:
00478 MajCInfo majCInfo;
00479
00480 //Set up some arrays.
00481 const Int_t size = md.size();
00482 // Float_t* xerr = new Float_t[fitLength];
00483 // Float_t* zerr = new Float_t[fitLength];
00484 if (size<fitLength){return majCInfo;}
00485
00486 multimap<Float_t, Float_t> mfits; //<abs(parabolic fit),(parabolic fit)>
00487 multimap<Float_t,Float_t>::const_iterator it = md.begin();
00488 Double_t totJitter = 0.0;
00489 Double_t totSqJitter = 0.0;
00490 Double_t prevCurvature = 0.0;
00491 Int_t numSegments = 0;
00492 /* Int_t endChop = 3;*///Don't use the final n segments in jitter
00493 //k loops over the fit segments.
00494 TGraphErrors gQuick(fitLength);
00495 for (Int_t k=0; k<(size-fitLength); ++k){
00496 // Float_t* z = new Float_t[fitLength];
00497 // Float_t* x = new Float_t[fitLength];
00498 // Float_t* absx = new Float_t[fitLength];
00499 Bool_t changesign = false;
00500 Bool_t positive = false;
00501 if (it->second > 0){positive = true;}
00502 //l loops over the strips in each fit segment
00503 //The variable 'positive' says whether the first strip in a
00504 //segment has a positive co-ordinate.
00505 for (Int_t l=0; l<fitLength; ++l)
00506 {
00507 Bool_t thispos = false;
00508 gQuick.SetPoint(l,it->first,fabs(it->second));
00509 gQuick.SetPointError(l,0.0594,0.041);
00510 // z[l] = it->first;
00511 // zerr[l] = 0.0594;
00512 // x[l] = it->second;
00513 // xerr[l] = 0.041;
00514 // absx[l] = fabs(it->second);
00515 if (it->second > 0){thispos = true;}
00516 if (thispos != positive){changesign = true;}
00517 ++it;
00518 }
00519 if (!changesign){
00520 // gQuick.Draw("A*");
00521 gQuick.Fit("pol2","Q");
00522 Float_t curviness = 2*(gQuick.GetFunction("pol2")->GetParameter(2));
00523 if ((numSegments/*-endChop*/)/* && (k<(size-fitLength-endChop))*/){
00524 totJitter += fabs(curviness - prevCurvature);
00525 totSqJitter +=
00526 (curviness - prevCurvature)*(curviness - prevCurvature);
00527 }
00528 ++numSegments;
00529 prevCurvature = curviness;
00530 // hCurv.Fill(curviness);
00531 mfits.insert(pair<Float_t,Float_t>(fabs(curviness),
00532 curviness));
00533 }
00534 for (Int_t l=0; l<fitLength; ++l)
00535 {
00536 --it;
00537 }
00538 ++it;
00539 // if(z){delete z; z=0;}
00540 // if(x){delete x; x=0;}
00541 // if(absx){delete absx; absx=0;}
00542
00543 majCInfo.jitter = -1.0;
00544 majCInfo.sqJitter = -1.0;
00545 // if (numSegments>1){
00546 // majCInfo.jitter = totJitter/((Double_t) (numSegments-1));
00547 // majCInfo.sqJitter = totSqJitter/((Double_t) (numSegments-1));
00548 // }
00549 if (numSegments/*-endChop*/){
00550 majCInfo.jitter = totJitter/((Double_t) (numSegments/*-endChop*/));
00551 majCInfo.sqJitter = totSqJitter/((Double_t) (numSegments/*-endChop*/));
00552 }
00553 gQuick.Clear();
00554 }
00555
00556 multimap<Float_t,Float_t>::const_iterator itfits = mfits.end();
00557 Int_t numRemove = 0;
00558 if (((Int_t) mfits.size()) >= numRemove){
00559 for (Int_t rem = 0; rem < numRemove; ++rem){
00560 itfits--;
00561 mfits.erase(itfits->first);
00562 itfits = mfits.end();
00563 }
00564 }
00565 TH1F hCurv("hCurv","",100,-5,5);
00566 Float_t smallestCurv=100.0;
00567 Float_t largestCurv = -100.0;
00568 for (itfits = mfits.begin();
00569 itfits != mfits.end();
00570 ++itfits){
00571 hCurv.Fill(itfits->second);
00572 if (itfits->second<smallestCurv){smallestCurv=itfits->second;}
00573 if (itfits->second>largestCurv){largestCurv=itfits->second;}
00574 }
00575
00576 // TCanvas cCurv("cCurv","",0,0,500,500);
00577 // hCurv.Draw();
00578 majCInfo.rms = hCurv.GetRMS();
00579 majCInfo.totWidth = largestCurv-smallestCurv;
00580 // cCurv.Print(Form("~/public_html/ASnarl%dEvent%d.gif",snarl,event));
00581 Float_t neg = hCurv.Integral(0,50);
00582 Float_t pos = hCurv.Integral(51,101);
00583 hvariances->Fill(hCurv.GetRMS());
00584 // flastVariance = hCurv.GetRMS();
00585 majCInfo.simpleMajC = pos-neg;
00586 if (neg){majCInfo.majCRatio = pos/neg;}
00587 else{majCInfo.majCRatio = 10.0;}
00588
00589 if (!pos){
00590 majCInfo.smoothMajC = -10.0;
00591 }
00592 else {
00593 if (!neg) {
00594 majCInfo.smoothMajC = 10.0;
00595 }
00596 else{
00597 majCInfo.smoothMajC = TMath::Log(pos/neg);
00598 }
00599 }
00600
00601 if (pos > neg) {
00602 if (neg) {majCInfo.majC = pos/neg; return majCInfo;}
00603 else {majCInfo.majC = 10.0; return majCInfo;}
00604 }
00605 if (neg > pos) {
00606 if (pos) {majCInfo.majC = -1.0*neg/pos; return majCInfo;}
00607 else {majCInfo.majC = -10.0; return majCInfo;}
00608 }
00609 if (neg == pos) {majCInfo.majC = 0.0; return majCInfo;}
00610 else {majCInfo.majC = 0.0; return majCInfo;}
00611 return majCInfo;
00612 }
|
|
||||||||||||
|
Definition at line 615 of file MajorityCurvature.cxx. References MajCInfo::jitter, MajCInfo::majC, MajCInfo::majCRatio, MajCInfo::simpleMajC, MajCInfo::smoothMajC, and MajCInfo::sqJitter. 00619 {
00620 //Object to return:
00621 MajCInfo majCInfo;
00622
00623 //Set up some arrays.
00624 const Int_t size = md.size();
00625 // Float_t* xerr = new Float_t[fitLength];
00626 // Float_t* zerr = new Float_t[fitLength];
00627 if (size<fitLength){return majCInfo;}
00628
00629 multimap<Float_t,Float_t>::const_iterator it = md.begin();
00630 Int_t numPositiveSegments = 0;
00631 Int_t numNegativeSegments = 0;
00632 //k loops over the fit segments.
00633 for (Int_t k=0; k<(size-fitLength); ++k){
00634 Bool_t changesign = false;
00635 Bool_t positive = false;
00636 if (it->second > 0){positive = true;}
00637 //l loops over the strips in each fit segment
00638 //The variable 'positive' says whether the first strip in a
00639 //segment has a positive co-ordinate.
00640 ++it;
00641 Int_t numPositiveIncrements = 0;
00642 Int_t numNegativeIncrements = 0;
00643 for (Int_t l=1; l<fitLength-1; ++l)
00644 {
00645 Bool_t thispos = false;
00646 --it;
00647 Double_t prevZ = it->first;
00648 Double_t prevX = it->second;
00649 ++it;
00650 Double_t thisZ = it->first;
00651 Double_t thisX = it->second;
00652 ++it;
00653 Double_t nextZ = it->first;
00654 Double_t nextX = it->second;
00655 if ((nextZ-thisZ) && (thisZ-prevZ)){
00656 Double_t forwardGrad = (nextX-thisX)/(nextZ-thisZ);
00657 Double_t backGrad = (thisX-prevX)/(thisZ-prevZ);
00658 if (positive){
00659 if (forwardGrad>backGrad){
00660 ++numPositiveIncrements;
00661 }
00662 if (backGrad>forwardGrad){
00663 ++numNegativeIncrements;
00664 }
00665 }
00666 else{
00667 if (forwardGrad>backGrad){
00668 ++numNegativeIncrements;
00669 }
00670 if (backGrad>forwardGrad){
00671 ++numPositiveIncrements;
00672 }
00673 }
00674 }
00675 --it;
00676 if (it->second > 0){thispos = true;}
00677 if (thispos != positive){changesign = true;}
00678 ++it;
00679 }
00680 if (!changesign){
00681 if (numPositiveIncrements>numNegativeIncrements){
00682 ++numPositiveSegments;
00683 }
00684 if (numNegativeIncrements>numPositiveIncrements){
00685 ++numNegativeSegments;
00686 }
00687 }
00688 for (Int_t l=1; l<fitLength-1; ++l)
00689 {
00690 --it;
00691 }
00692 ++it;
00693
00694 majCInfo.jitter = -1.0;
00695 majCInfo.sqJitter = -1.0;
00696 }
00697
00698 majCInfo.simpleMajC = numPositiveSegments-numNegativeSegments;
00699 if (numNegativeSegments){majCInfo.majCRatio = numPositiveSegments/numNegativeSegments;}
00700 else{majCInfo.majCRatio = 10.0;}
00701
00702 if (!numPositiveSegments){
00703 majCInfo.smoothMajC = -10.0;
00704 }
00705 else {
00706 if (!numNegativeSegments) {
00707 majCInfo.smoothMajC = 10.0;
00708 }
00709 else{
00710 majCInfo.smoothMajC = TMath::Log(numPositiveSegments/numNegativeSegments);
00711 }
00712 }
00713
00714 if (numPositiveSegments > numNegativeSegments) {
00715 if (numNegativeSegments) {majCInfo.majC = numPositiveSegments/numNegativeSegments; return majCInfo;}
00716 else {majCInfo.majC = 10.0; return majCInfo;}
00717 }
00718 if (numNegativeSegments > numPositiveSegments) {
00719 if (numPositiveSegments) {majCInfo.majC = -1.0*numNegativeSegments/numPositiveSegments; return majCInfo;}
00720 else {majCInfo.majC = -10.0; return majCInfo;}
00721 }
00722 if (numNegativeSegments == numPositiveSegments) {majCInfo.majC = 0.0; return majCInfo;}
00723 else {majCInfo.majC = 0.0; return majCInfo;}
00724 return majCInfo;
00725 }
|
|
||||||||||||
|
Definition at line 764 of file MajorityCurvature.cxx. References SRMom::ArrayXAlongTrack(), and CalcCurv(). 00766 {
00767 SRMom srMom;
00768 const multimap<Float_t, Float_t> md
00769 = srMom.ArrayXAlongTrack(track);
00770 return CalcCurv(md, fitLength);
00771 }
|
|
||||||||||||||||||||
|
Definition at line 728 of file MajorityCurvature.cxx. References SRMom::ArrayXAlongTrack(), and CalcCurv(). Referenced by XCurvature(). 00732 {
00733 SRMom srMom(mom);
00734 const multimap<Float_t, Float_t> md
00735 = srMom.ArrayXAlongTrack(event,track);
00736 return CalcCurv(md, fitLength);
00737 }
|
|
||||||||||||
|
Definition at line 754 of file MajorityCurvature.cxx. References SRMom::ArrayXAlongTrack(), and CalcCurvObject(). 00756 {
00757 SRMom srMom;
00758 const multimap<Float_t, Float_t> md
00759 = srMom.ArrayXAlongTrack(track);
00760 return CalcCurvObject(md, fitLength);
00761 }
|
|
||||||||||||||||||||
|
Definition at line 741 of file MajorityCurvature.cxx. References SRMom::ArrayXAlongTrack(), and CalcCurvObject(). Referenced by XCurvatureObject(). 00745 {
00746 SRMom srMom(mom);
00747 const multimap<Float_t, Float_t> md
00748 = srMom.ArrayXAlongTrack(event,track);
00749 return CalcCurvObject(md, fitLength);
00750 }
|
|
||||||||||||
|
Definition at line 810 of file MajorityCurvature.cxx. References SRMom::ArrayYAlongTrack(), and CalcCurv(). 00812 {
00813 SRMom srMom;
00814 const multimap<Float_t, Float_t> md
00815 = srMom.ArrayYAlongTrack(track);
00816 return CalcCurv(md, fitLength);
00817 }
|
|
||||||||||||||||||||
|
Definition at line 774 of file MajorityCurvature.cxx. References SRMom::ArrayYAlongTrack(), and CalcCurv(). Referenced by YCurvature(). 00778 {
00779 SRMom srMom(mom);
00780 const multimap<Float_t, Float_t> md
00781 = srMom.ArrayYAlongTrack(event,track);
00782 return CalcCurv(md, fitLength);
00783 }
|
|
||||||||||||
|
Definition at line 800 of file MajorityCurvature.cxx. References SRMom::ArrayYAlongTrack(), and CalcCurvObject(). 00802 {
00803 SRMom srMom;
00804 const multimap<Float_t, Float_t> md
00805 = srMom.ArrayYAlongTrack(track);
00806 return CalcCurvObject(md, fitLength);
00807 }
|
|
||||||||||||||||||||
|
Definition at line 787 of file MajorityCurvature.cxx. References SRMom::ArrayYAlongTrack(), and CalcCurvObject(). Referenced by YCurvatureObject(). 00791 {
00792 SRMom srMom(mom);
00793 const multimap<Float_t, Float_t> md
00794 = srMom.ArrayYAlongTrack(event,track);
00795 return CalcCurvObject(md, fitLength);
00796 }
|
|
|
Definition at line 820 of file MajorityCurvature.cxx. References XCurvature(), and YCurvature(). 00821 {
00822 Float_t xCurv = XCurvature(track);
00823 Float_t yCurv = YCurvature(track);
00824 if (fabs(yCurv) > fabs(xCurv)){return yCurv;}
00825 else {return xCurv;}
00826 }
|
|
||||||||||||||||
|
Definition at line 861 of file MajorityCurvature.cxx. References XCurvature(), and YCurvature(). 00864 {
00865 Float_t xCurv = XCurvature(mom,event,track);
00866 Float_t yCurv = YCurvature(mom,event,track);
00867 if (fabs(yCurv) > fabs(xCurv)){return yCurv;}
00868 else {return xCurv;}
00869 }
|
|
||||||||||||||||
|
Definition at line 872 of file MajorityCurvature.cxx. References CalcCombCurv(), FitLength(), NextFitLength(), and SRMom::TrackLengthPlanes(). 00875 {
00876 SRMom srMom(mom);
00877 const Int_t trkLthPln = srMom.TrackLengthPlanes(event,track);
00878 Int_t fitLength = FitLength(trkLthPln);
00879 if (!fitLength) {return 0.0;}
00880 Float_t xCurv = CalcCombCurv(mom,event,track,fitLength);
00881 if (xCurv) {return xCurv;}
00882 while (!xCurv){
00883 fitLength = NextFitLength(trkLthPln,fitLength);
00884 if (!fitLength){return 0.0;}
00885 xCurv = CalcCombCurv(mom,event,track,fitLength);
00886 }
00887 return xCurv;
00888 }
|
|
||||||||||||||||
|
Definition at line 845 of file MajorityCurvature.cxx. References JPID(), MajCInfo::jPID, MajCInfo::majC, SRMom::TrackVtxQOvP(), XCurvatureObject(), and YCurvatureObject(). 00848 {
00849 MajCInfo xCurv = XCurvatureObject(mom,event,track);
00850 MajCInfo yCurv = YCurvatureObject(mom,event,track);
00851 MajCInfo* bestCurv;
00852 if (fabs(yCurv.majC) > fabs(xCurv.majC)){bestCurv = &yCurv;}
00853 else {bestCurv = &xCurv;}
00854 SRMom srMom(mom);
00855 Double_t qp = srMom.TrackVtxQOvP(event,track);
00856 bestCurv->jPID = this->JPID(qp,bestCurv->majC);
00857 return *bestCurv;
00858 }
|
|
|
Definition at line 830 of file MajorityCurvature.cxx. References JPID(), MajCInfo::jPID, MajCInfo::majC, SRMom::TrackVtxQOvP(), XCurvatureObject(), and YCurvatureObject(). Referenced by NuExtraction::ExtractMajorityCurvature(). 00831 {
00832 MajCInfo xCurv = XCurvatureObject(track);
00833 MajCInfo yCurv = YCurvatureObject(track);
00834 MajCInfo* bestCurv;
00835 if (fabs(yCurv.majC) > fabs(xCurv.majC)){bestCurv = &yCurv;}
00836 else {bestCurv = &xCurv;}
00837 SRMom srMom;
00838 Double_t qp = srMom.TrackVtxQOvP(track);
00839 bestCurv->jPID = this->JPID(qp,bestCurv->majC);
00840 return *bestCurv;
00841 }
|
|
|
Definition at line 891 of file MajorityCurvature.cxx. References fitLengths. Referenced by CurvatureComb(), XCurvature(), XCurvatureObject(), YCurvature(), and YCurvatureObject(). 00892 {
00893 return fitLengths[trkLthPln][0];
00894 }
|
|
||||||||||||
|
Definition at line 897 of file MajorityCurvature.cxx. References fhMajCBa, fhMajCNC, fhMajCNu, fhQOverPBa, fhQOverPNC, and fhQOverPNu. Referenced by CurvatureImproved(). 00899 {
00900 Double_t pBackMajC =
00901 fhMajCNu->GetBinContent(fhMajCNu->GetXaxis()->FindBin(majC));
00902 pBackMajC +=
00903 fhMajCNC->GetBinContent(fhMajCNC->GetXaxis()->FindBin(majC));
00904 Double_t pSigMajC =
00905 fhMajCBa->GetBinContent(fhMajCBa->GetXaxis()->FindBin(majC));
00906
00907 Double_t pBackqOvp =
00908 fhQOverPNu->GetBinContent(fhQOverPNu->GetXaxis()->FindBin(qOverP));
00909 pBackqOvp +=
00910 fhQOverPNC->GetBinContent(fhQOverPNC->GetXaxis()->FindBin(qOverP));
00911 Double_t pSigqOvp =
00912 fhQOverPBa->GetBinContent(fhQOverPBa->GetXaxis()->FindBin(qOverP));
00913
00914 Float_t numerator =
00915 pBackMajC*pBackqOvp;
00916 if (numerator<0.0001){numerator = 0.0001;}
00917 Float_t denominator =
00918 pSigMajC*pSigqOvp;
00919 if (denominator<0.0001){denominator = 0.0001;}
00920
00921 Double_t jPID = log(numerator/denominator);
00922 return jPID;
00923 }
|
|
||||||||||||
|
Definition at line 926 of file MajorityCurvature.cxx. References fitLengths. Referenced by CurvatureComb(), XCurvature(), XCurvatureObject(), YCurvature(), and YCurvatureObject(). 00929 {
00930 Int_t i=0;
00931 Int_t fitLength = 0;
00932 for (i=0; fitLength != lastFitLength; ++i){
00933 fitLength = fitLengths[trkLthPln][i];
00934 if (!fitLength){return fitLength;}
00935 }
00936 return fitLengths[trkLthPln][i];
00937 }
|
|
|
Definition at line 997 of file MajorityCurvature.cxx. References CalcXCurv(), FitLength(), NextFitLength(), and SRMom::TrackLengthPlanes(). 00999 {
01000 SRMom srMom;
01001 const Int_t trkLthPln = srMom.TrackLengthPlanes(track);
01002 Int_t fitLength = FitLength(trkLthPln);
01003 if (!fitLength) {return 0.0;}
01004 Float_t xCurv = CalcXCurv(track,fitLength);
01005 if (xCurv) {return xCurv;}
01006 while (!xCurv){
01007 fitLength = NextFitLength(trkLthPln,fitLength);
01008 if (!fitLength){return 0.0;}
01009 xCurv = CalcXCurv(track,fitLength);
01010 }
01011 return xCurv;
01012 }
|
|
||||||||||||||||
|
Definition at line 940 of file MajorityCurvature.cxx. References CalcXCurv(), FitLength(), NextFitLength(), and SRMom::TrackLengthPlanes(). Referenced by Curvature(). 00943 {
00944 SRMom srMom(mom);
00945 const Int_t trkLthPln = srMom.TrackLengthPlanes(event,track);
00946 Int_t fitLength = FitLength(trkLthPln);
00947 if (!fitLength) {return 0.0;}
00948 Float_t xCurv = CalcXCurv(mom,event,track,fitLength);
00949 if (xCurv) {return xCurv;}
00950 while (!xCurv){
00951 fitLength = NextFitLength(trkLthPln,fitLength);
00952 if (!fitLength){return 0.0;}
00953 xCurv = CalcXCurv(mom,event,track,fitLength);
00954 }
00955 return xCurv;
00956 }
|
|
|
Definition at line 980 of file MajorityCurvature.cxx. References CalcXCurvObject(), FitLength(), MajCInfo::majC, NextFitLength(), and SRMom::TrackLengthPlanes(). 00981 {
00982 SRMom srMom;
00983 const Int_t trkLthPln = srMom.TrackLengthPlanes(track);
00984 Int_t fitLength = FitLength(trkLthPln);
00985 if (!fitLength) {MajCInfo empty; return empty;}
00986 MajCInfo xCurv = CalcXCurvObject(track,fitLength);
00987 if (xCurv.majC) {return xCurv;}
00988 while (!xCurv.majC){
00989 fitLength = NextFitLength(trkLthPln,fitLength);
00990 if (!fitLength){MajCInfo empty; return empty;}
00991 xCurv = CalcXCurvObject(track,fitLength);
00992 }
00993 return xCurv;
00994 }
|
|
||||||||||||||||
|
Definition at line 960 of file MajorityCurvature.cxx. References CalcXCurvObject(), FitLength(), MajCInfo::majC, NextFitLength(), and SRMom::TrackLengthPlanes(). Referenced by CurvatureImproved(). 00963 {
00964 SRMom srMom(mom);
00965 const Int_t trkLthPln = srMom.TrackLengthPlanes(event,track);
00966 Int_t fitLength = FitLength(trkLthPln);
00967 if (!fitLength) {MajCInfo empty; return empty;}
00968 MajCInfo xCurv = CalcXCurvObject(mom,event,track,fitLength);
00969 if (xCurv.majC) {return xCurv;}
00970 while (!xCurv.majC){
00971 fitLength = NextFitLength(trkLthPln,fitLength);
00972 if (!fitLength){MajCInfo empty; return empty;}
00973 xCurv = CalcXCurvObject(mom,event,track,fitLength);
00974 }
00975 return xCurv;
00976 }
|
|
|
Definition at line 1072 of file MajorityCurvature.cxx. References CalcYCurv(), FitLength(), NextFitLength(), and SRMom::TrackLengthPlanes(). 01073 {
01074 SRMom srMom;
01075 const Int_t trkLthPln = srMom.TrackLengthPlanes(track);
01076 Int_t fitLength = FitLength(trkLthPln);
01077 if (!fitLength) {return 0.0;}
01078 Float_t yCurv = CalcYCurv(track,fitLength);
01079 if (yCurv) {return yCurv;}
01080 while (!yCurv){
01081 fitLength = NextFitLength(trkLthPln,fitLength);
01082 if (!fitLength){return 0.0;}
01083 yCurv = CalcYCurv(track,fitLength);
01084 }
01085 return yCurv;
01086 }
|
|
||||||||||||||||
|
Definition at line 1015 of file MajorityCurvature.cxx. References CalcYCurv(), FitLength(), NextFitLength(), and SRMom::TrackLengthPlanes(). Referenced by Curvature(). 01018 {
01019 SRMom srMom(mom);
01020 const Int_t trkLthPln = srMom.TrackLengthPlanes(event,track);
01021 Int_t fitLength = FitLength(trkLthPln);
01022 if (!fitLength) {return 0.0;}
01023 Float_t yCurv = CalcYCurv(mom,event,track,fitLength);
01024 if (yCurv) {return yCurv;}
01025 while (!yCurv){
01026 fitLength = NextFitLength(trkLthPln,fitLength);
01027 if (!fitLength){return 0.0;}
01028 yCurv = CalcYCurv(mom,event,track,fitLength);
01029 }
01030 return yCurv;
01031 }
|
|
|
Definition at line 1055 of file MajorityCurvature.cxx. References CalcYCurvObject(), FitLength(), MajCInfo::majC, NextFitLength(), and SRMom::TrackLengthPlanes(). 01056 {
01057 SRMom srMom;
01058 const Int_t trkLthPln = srMom.TrackLengthPlanes(track);
01059 Int_t fitLength = FitLength(trkLthPln);
01060 if (!fitLength) {MajCInfo empty; return empty;}
01061 MajCInfo yCurv = CalcYCurvObject(track,fitLength);
01062 if (yCurv.majC) {return yCurv;}
01063 while (!yCurv.majC){
01064 fitLength = NextFitLength(trkLthPln,fitLength);
01065 if (!fitLength){MajCInfo empty; return empty;}
01066 yCurv = CalcYCurvObject(track,fitLength);
01067 }
01068 return yCurv;
01069 }
|
|
||||||||||||||||
|
Definition at line 1035 of file MajorityCurvature.cxx. References CalcYCurvObject(), FitLength(), MajCInfo::majC, NextFitLength(), and SRMom::TrackLengthPlanes(). Referenced by CurvatureImproved(). 01038 {
01039 SRMom srMom(mom);
01040 const Int_t trkLthPln = srMom.TrackLengthPlanes(event,track);
01041 Int_t fitLength = FitLength(trkLthPln);
01042 if (!fitLength) {MajCInfo empty; return empty;}
01043 MajCInfo yCurv = CalcYCurvObject(mom,event,track,fitLength);
01044 if (yCurv.majC) {return yCurv;}
01045 while (!yCurv.majC){
01046 fitLength = NextFitLength(trkLthPln,fitLength);
01047 if (!fitLength){MajCInfo empty; return empty;}
01048 yCurv = CalcYCurvObject(mom,event,track,fitLength);
01049 }
01050 return yCurv;
01051 }
|
|
|
Definition at line 108 of file MajorityCurvature.h. Referenced by JPID(), and ~MajorityCurvature(). |
|
|
Definition at line 109 of file MajorityCurvature.h. Referenced by JPID(), and ~MajorityCurvature(). |
|
|
Definition at line 110 of file MajorityCurvature.h. Referenced by JPID(), and ~MajorityCurvature(). |
|
|
Definition at line 111 of file MajorityCurvature.h. Referenced by JPID(), and ~MajorityCurvature(). |
|
|
Definition at line 112 of file MajorityCurvature.h. Referenced by JPID(), and ~MajorityCurvature(). |
|
|
Definition at line 113 of file MajorityCurvature.h. Referenced by JPID(), and ~MajorityCurvature(). |
|
|
Definition at line 146 of file MajorityCurvature.h. Referenced by FitLength(), and NextFitLength(). |
|
|
Definition at line 114 of file MajorityCurvature.h. Referenced by ~MajorityCurvature(). |
|
|
Definition at line 109 of file MajorityCurvature.cxx. Referenced by CalcCurv(), and CalcCurvObject(). |
1.3.9.1