Changeset View
Changeset View
Standalone View
Standalone View
validation/compareRootFiles.cc
Show First 20 Lines • Show All 429 Lines • ▼ Show 20 Lines | void compareRootFiles::getNDaugPlots() | ||||
gifFileName.append( _decayName ); | gifFileName.append( _decayName ); | ||||
gifFileName.append( "_daugHist.gif" ); | gifFileName.append( "_daugHist.gif" ); | ||||
_theCanvas->Print( gifFileName.c_str() ); | _theCanvas->Print( gifFileName.c_str() ); | ||||
} | } | ||||
TH1D* compareRootFiles::getMtmHist( TFile* theFile, string histName, | TH1D* compareRootFiles::getMtmHist( TFile* theFile, string histName, | ||||
vector<int> groupInts ) | vector<int> groupInts ) | ||||
{ | { | ||||
if ( theFile == 0 ) { | if ( theFile == nullptr ) { | ||||
// Return empty histogram | // Return empty histogram | ||||
return _emptyHist; | return _emptyHist; | ||||
} | } | ||||
TTree* theTree = dynamic_cast<TTree*>( theFile->Get( "Data" ) ); | TTree* theTree = dynamic_cast<TTree*>( theFile->Get( "Data" ) ); | ||||
if ( theTree == 0 ) { | if ( theTree == nullptr ) { | ||||
// Return empty histogram | // Return empty histogram | ||||
return _emptyHist; | return _emptyHist; | ||||
} | } | ||||
int id; | int id; | ||||
double p; | double p; | ||||
theTree->SetBranchAddress( "id", &id ); | theTree->SetBranchAddress( "id", &id ); | ||||
theTree->SetBranchAddress( "p", &p ); | theTree->SetBranchAddress( "p", &p ); | ||||
Show All 23 Lines | |||||
} | } | ||||
TH1D* compareRootFiles::getPartIdHist( TFile* theFile, string histName ) | TH1D* compareRootFiles::getPartIdHist( TFile* theFile, string histName ) | ||||
{ | { | ||||
// Group pi,K,D etc.. into groups and plot multiplicities | // Group pi,K,D etc.. into groups and plot multiplicities | ||||
// with bins along the x axis representing each group | // with bins along the x axis representing each group | ||||
// leptons gamma pi+- pi0 K+- K0 D+- D0 light_baryons strange_baryons other | // leptons gamma pi+- pi0 K+- K0 D+- D0 light_baryons strange_baryons other | ||||
if ( theFile == 0 ) { | if ( theFile == nullptr ) { | ||||
// Return empty histogram | // Return empty histogram | ||||
return _emptyHist; | return _emptyHist; | ||||
} | } | ||||
TTree* theTree = dynamic_cast<TTree*>( theFile->Get( "Data" ) ); | TTree* theTree = dynamic_cast<TTree*>( theFile->Get( "Data" ) ); | ||||
if ( theTree == 0 ) { | if ( theTree == nullptr ) { | ||||
// Return empty histogram | // Return empty histogram | ||||
return _emptyHist; | return _emptyHist; | ||||
} | } | ||||
int id; | int id; | ||||
theTree->SetBranchAddress( "id", &id ); | theTree->SetBranchAddress( "id", &id ); | ||||
int nGroupMax = _nGroupMax; | int nGroupMax = _nGroupMax; | ||||
▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | if ( absPDGId >= 11 && absPDGId <= 16 ) { | ||||
group = 10; // other particles | group = 10; // other particles | ||||
} | } | ||||
return group; | return group; | ||||
} | } | ||||
TH1D* compareRootFiles::getAllIdHist( TFile* theFile, string histName ) | TH1D* compareRootFiles::getAllIdHist( TFile* theFile, string histName ) | ||||
{ | { | ||||
if ( theFile == 0 ) { | if ( theFile == nullptr ) { | ||||
// Return empty histogram | // Return empty histogram | ||||
return _emptyHist; | return _emptyHist; | ||||
} | } | ||||
TTree* theTree = dynamic_cast<TTree*>( theFile->Get( "Data" ) ); | TTree* theTree = dynamic_cast<TTree*>( theFile->Get( "Data" ) ); | ||||
if ( theTree == 0 ) { | if ( theTree == nullptr ) { | ||||
// Return empty histogram | // Return empty histogram | ||||
return _emptyHist; | return _emptyHist; | ||||
} | } | ||||
int id; | int id; | ||||
theTree->SetBranchAddress( "id", &id ); | theTree->SetBranchAddress( "id", &id ); | ||||
// Just limit the PDG id integer codes up to 4000 | // Just limit the PDG id integer codes up to 4000 | ||||
Show All 12 Lines | TH1D* compareRootFiles::getAllIdHist( TFile* theFile, string histName ) | ||||
idHist->Scale( 1.0 / nIdScale ); | idHist->Scale( 1.0 / nIdScale ); | ||||
idHist->SetMaximum( 1.0 ); | idHist->SetMaximum( 1.0 ); | ||||
return idHist; | return idHist; | ||||
} | } | ||||
TH1D* compareRootFiles::getDaugHist( TFile* theFile, string histName ) | TH1D* compareRootFiles::getDaugHist( TFile* theFile, string histName ) | ||||
{ | { | ||||
if ( theFile == 0 ) { | if ( theFile == nullptr ) { | ||||
// Return empty histogram | // Return empty histogram | ||||
return _emptyHist; | return _emptyHist; | ||||
} | } | ||||
TTree* nDaugTree = dynamic_cast<TTree*>( theFile->Get( "nDaugTree" ) ); | TTree* nDaugTree = dynamic_cast<TTree*>( theFile->Get( "nDaugTree" ) ); | ||||
if ( nDaugTree == 0 ) { | if ( nDaugTree == nullptr ) { | ||||
// Return empty histogram | // Return empty histogram | ||||
return _emptyHist; | return _emptyHist; | ||||
} | } | ||||
int nDaug; | int nDaug; | ||||
nDaugTree->SetBranchAddress( "nDaug", &nDaug ); | nDaugTree->SetBranchAddress( "nDaug", &nDaug ); | ||||
int nDaugMax = (int)nDaugTree->GetMaximum( "nDaug" ); | int nDaugMax = (int)nDaugTree->GetMaximum( "nDaug" ); | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |