本文整理汇总了C++中DataTree::makeOutputTree方法的典型用法代码示例。如果您正苦于以下问题:C++ DataTree::makeOutputTree方法的具体用法?C++ DataTree::makeOutputTree怎么用?C++ DataTree::makeOutputTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataTree
的用法示例。
在下文中一共展示了DataTree::makeOutputTree方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
// Read pedestals file
char tempFilePed[500];
int iRun;
sprintf(tempFilePed, "%s/pedestals_%s.dat", getenv("PEDESTALS"), argv[1]);
cout << "... Reading: " << tempFilePed << endl;
ifstream filePed(tempFilePed);
for (int i=0; i<8; i++) {
filePed >> iRun >> pedQadc[i];
pedQadc[i] = pmtPedestals[i][0]; //replace pedQadc[i] with the pedestals separately loaded
}
for (int i=0; i<32; i++) {
filePed >> iRun >> pedPdc2[i];
}
for (int i=0; i<32; i++) {
filePed >> iRun >> pedPadc[i];
}
filePed >> iRun >> pedPdc30;
filePed >> iRun >> pedPdc34;
//cout << iRun << " " << pedPdc30 << endl;
//cout << iRun << " " << pedPdc34 << endl;
// Open output ntuple
DataTree *t = new DataTree();
t->makeOutputTree(std::string(tempOut),"pass1");
// Open input ntuple
char tempIn[500];
sprintf(tempIn, "%s/full%s.root",getenv("UCNA_RAW_DATA"), argv[1]);
TFile *fileIn = new TFile(tempIn, "READ");
TTree *Tin = (TTree*)(fileIn->Get("h1"));
// Variables
Tin->SetBranchAddress("Pdc30", &Pdc30);
Tin->SetBranchAddress("Pdc34", &Pdc34);
Tin->SetBranchAddress("Tdc016", &Tdc016);
Tin->SetBranchAddress("Tdc017", &Tdc017);
Tin->SetBranchAddress("Tdc00", &Tdc00);
Tin->SetBranchAddress("Tdc01", &Tdc01);
Tin->SetBranchAddress("Tdc02", &Tdc02);
Tin->SetBranchAddress("Tdc03", &Tdc03);
Tin->SetBranchAddress("Tdc08", &Tdc08);
Tin->SetBranchAddress("Tdc09", &Tdc09);
Tin->SetBranchAddress("Tdc014", &Tdc010); //Note that what used to be TDC10 is now TDC14
Tin->SetBranchAddress("Tdc011", &Tdc011);
Tin->SetBranchAddress("Sis00", &Sis00);
Tin->SetBranchAddress("Qadc0", &Qadc[0]);
Tin->SetBranchAddress("Qadc1", &Qadc[1]);
Tin->SetBranchAddress("Qadc2", &Qadc[2]);
Tin->SetBranchAddress("Qadc3", &Qadc[3]);
Tin->SetBranchAddress("Qadc4", &Qadc[4]);
Tin->SetBranchAddress("Qadc5", &Qadc[5]);
示例2: main
int main(int argc, char *argv[])
{
cout.setf(ios::fixed, ios::floatfield);
cout.precision(12);
TH1::AddDirectory(kFALSE);
cout << "Run " << argv[1] << " ..." << endl;
// Read cuts file
char tempFileCuts[500];
sprintf(tempFileCuts, "%s/cuts_%s.dat", getenv("CUTS"),argv[1]);
cout << "... Reading: " << tempFileCuts << endl;
ifstream fileCuts(tempFileCuts);
fileCuts >> cutBeamBurstTime >> comment;
fileCuts >> nCutsTimeWindows >> comment;
if (nCutsTimeWindows > 0) {
for (int i=0; i<nCutsTimeWindows; i++) {
fileCuts >> cutTimeWindowLower[i] >> cutTimeWindowUpper[i];
}
}
fileCuts >> cutEastAnode >> comment;
fileCuts >> cutWestAnode >> comment;
fileCuts >> cutEastTwoFold >> comment;
fileCuts >> cutWestTwoFold >> comment;
fileCuts >> cutEastTopVetoQADC >> comment;
fileCuts >> cutEastTopVetoTDC >> comment;
fileCuts >> cutEastDriftTubeTAC >> comment;
fileCuts >> cutWestDriftTubeTAC >> comment;
fileCuts >> cutEastBackingVetoQADC >> comment;
fileCuts >> cutEastBackingVetoTDC >> comment;
fileCuts >> cutWestBackingVetoQADC >> comment;
fileCuts >> cutWestBackingVetoTDC >> comment;
cout << "... Beam Burst T0 Cut: " << cutBeamBurstTime << endl;
cout << "... Number of Time Windows Cuts: " << nCutsTimeWindows << endl;
if (nCutsTimeWindows > 0) {
for (int i=0; i<nCutsTimeWindows; i++) {
cout << " [" << cutTimeWindowLower[i] << ", " << cutTimeWindowUpper[i] << "]" << endl;
}
}
cout << "... East MWPC Anode Cut: " << cutEastAnode << endl;
cout << "... West MWPC Anode Cut: " << cutWestAnode << endl;
cout << "... East Scintillator Two-Fold Trigger Cut: " << cutEastTwoFold << endl;
cout << "... West Scintillator Two-Fold Trigger Cut: " << cutWestTwoFold << endl;
cout << "... East Top Veto QADC Cut: " << cutEastTopVetoQADC << endl;
cout << "... East Top Veto TDC Cut: " << cutEastTopVetoTDC << endl;
cout << "... East Drift Tube TAC Cut: " << cutEastDriftTubeTAC << endl;
cout << "... West Drift Tube TAC Cut: " << cutWestDriftTubeTAC << endl;
cout << "... East Backing Veto QADC Cut: " << cutEastBackingVetoQADC << endl;
cout << "... East Backing Veto TDC Cut: " << cutEastBackingVetoTDC << endl;
cout << "... West Backing Veto QADC Cut: " << cutWestBackingVetoQADC << endl;
cout << "... West Backing Veto TDC Cut: " << cutWestBackingVetoTDC << endl;
// Read pedestals file
char tempFilePed[500];
int iRun;
sprintf(tempFilePed, "%s/pedestals_%s.dat", getenv("PEDESTALS"), argv[1]);
cout << "... Reading: " << tempFilePed << endl;
ifstream filePed(tempFilePed);
for (int i=0; i<8; i++) {
filePed >> iRun >> pedQadc[i];
}
for (int i=0; i<32; i++) {
filePed >> iRun >> pedPdc2[i];
}
for (int i=0; i<32; i++) {
filePed >> iRun >> pedPadc[i];
}
//filePed >> iRun >> pedPdc30;
//filePed >> iRun >> pedPdc34;
//cout << iRun << " " << pedPdc30 << endl;
//cout << iRun << " " << pedPdc34 << endl;
// Open output ntuple
char tempOut[500];
sprintf(tempOut, "%s/replay_pass1_%s.root",getenv("REPLAY_PASS1"), argv[1]);
//sprintf(tempOut, "replay_pass1_%s.root", argv[1]);
DataTree t;// = new DataTree();
t.makeOutputTree(std::string(tempOut),"pass1");
// East MWPC y
posPdc2[0] = 76.20;
posPdc2[1] = 66.04;
posPdc2[2] = 55.88;
posPdc2[3] = 45.72;
posPdc2[4] = 35.56;
posPdc2[5] = 25.40;
posPdc2[6] = 15.24;
posPdc2[7] = 5.08;
posPdc2[8] = -5.08;
posPdc2[9] = -15.24;
posPdc2[10] = -25.40;
posPdc2[11] = -35.56;
posPdc2[12] = -45.72;
//.........这里部分代码省略.........
示例3: main
int main(int argc, char *argv[])
{
if ( argc<2 || argc>3 ) {
std::cout << "USAGE: ./replay_pass3.exe [run] [applyEndpointGain = false]\n\n";
exit(0);
}
cout.setf(ios::fixed, ios::floatfield);
cout.precision(12);
int runNumber = atoi(argv[1]);
bool applyEndpointGain = false;
if ( argc==3 && ( TString(argv[2])==TString("true") || atoi(argv[2])==1 ) ) applyEndpointGain = true;
int nPMT = 8;
int nParams = 3; //takes a quadratic
// Run number integer
cout << "Run " << runNumber << " ..." << endl;
char tempOut[500];
sprintf(tempOut, "%s/replay_pass3_%s.root",getenv("REPLAY_PASS3"), argv[1]);
//sprintf(tempOut, "replay_pass3_%s.root", argv[1]);
//Check if the file is good already and quit if it is so that we can
// only replay the files that are bad...
if ( OnlyReplayBadFiles ) {
if ( checkIfReplayFileIsGood(std::string(tempOut)) == 1 ) return 1;
else {
std::ofstream badRuns("badRuns.txt", std::fstream::app);
badRuns << argv[1] << "\n";
badRuns.close();
}
}
// Reading in pedestals file to get cathode pedestals
// Read pedestals file
char tempFilePed[500];
int iRun;
sprintf(tempFilePed, "%s/pedestals_%s.dat", getenv("PEDESTALS"), argv[1]);
std::cout << "... Reading: " << tempFilePed << std::endl;
std::ifstream filePed(tempFilePed);
for (int i=0; i<8; i++) {
filePed >> iRun >> pedQadc[i];
}
for (int i=0; i<32; i++) {
filePed >> iRun >> pedPdc2[i];
}
for (int i=0; i<32; i++) {
filePed >> iRun >> pedPadc[i];
}
filePed >> iRun >> pedPdc30;
filePed >> iRun >> pedPdc34;
cout << "... Applying Calibration ..." << endl;
unsigned int calibrationPeriod = getSrcRunPeriod(runNumber);
LinearityCurve linearityCurve(calibrationPeriod,false); //Get the linearity curve
EreconParameterization eRecon(runNumber); //Load the simulated relationship between EQ and Etrue
WirechamberCal mwpcCal(runNumber); //Load the Wirechamber Calibration
std::vector <Double_t> epGain(8,1.); // Loading the endpoint gain factors if they are to be used
if ( applyEndpointGain ) epGain = loadEndpointGain(runNumber);
std::vector <Int_t> pmtQuality = getEreconPMTQuality(runNumber); //Read in PMT quality file
std::vector <Double_t> alpha = GetAlphaValues(calibrationPeriod); //Get values for nPE/keV...
PositionMap posmap(5.0,50.); //Reading Scintillator position maps
posmap.readPositionMap( getXeRunPeriod(runNumber), "endpoint" );
MWPCPositionMap anodeMap(5., 50.); // Reading Anode position maps
anodeMap.readMWPCPositionMap( getXeRunPeriodForMWPCmap(runNumber) ,250.,300.); // Using 250-300 keV because that's the most probable range
DataTree *t = new DataTree(); // DataTree structure for input pass2 and output pass3
t->makeOutputTree(std::string(tempOut),"pass3"); // Open output ntuple
// Input ntuple
char tempIn[500];
sprintf(tempIn, "%s/replay_pass2_%s.root", getenv("REPLAY_PASS2"),argv[1]);
t->setupInputTree(std::string(tempIn),"pass2");
int nEvents = t->getEntries();
cout << "... Processing nEvents = " << nEvents << endl;
vector < vector <Int_t> > gridPoint;
vector < Double_t > eta;
vector < Double_t > old_eta;
vector < Double_t > gaus_eta;
//.........这里部分代码省略.........
示例4: main
int main(int argc, char *argv[])
{
cout.setf(ios::fixed, ios::floatfield);
cout.precision(12);
cout << "Run " << argv[1] << " ..." << endl;
cout << "... Applying Bi pulser gain corrections ..." << endl;
// Read gain corrections file
char tempFileGain[500];
sprintf(tempFileGain, "%s/gain_bismuth_%s.dat",getenv("GAIN_BISMUTH"), argv[1]);
cout << "... Reading: " << tempFileGain << endl;
double fitMean[8], gainCorrection[8];
ifstream fileGain(tempFileGain);
for (int i=0; i<8; i++) {
fileGain >> fitMean[i] >> gainCorrection[i];
}
cout << "... PMT E1: " << gainCorrection[0] << endl;
cout << "... PMT E2: " << gainCorrection[1] << endl;
cout << "... PMT E3: " << gainCorrection[2] << endl;
cout << "... PMT E4: " << gainCorrection[3] << endl;
cout << "... PMT W1: " << gainCorrection[4] << endl;
cout << "... PMT W2: " << gainCorrection[5] << endl;
cout << "... PMT W3: " << gainCorrection[6] << endl;
cout << "... PMT W4: " << gainCorrection[7] << endl;
// Open output ntuple
char tempOut[500];
sprintf(tempOut, "%s/replay_pass2_%s.root",getenv("REPLAY_PASS2"), argv[1]);
//sprintf(tempOut, "replay_pass2_%s.root", argv[1]);
DataTree *t = new DataTree();
t->makeOutputTree(std::string(tempOut),"pass2");
char tempIn[500];
sprintf(tempIn, "%s/replay_pass1_%s.root", getenv("REPLAY_PASS1"),argv[1]);
//sprintf(tempIn, "../replay_pass1/replay_pass1_%s.root", argv[1]);
t->setupInputTree(std::string(tempIn),"pass1");
int nEvents = t->getEntries();
cout << "... Processing nEvents = " << nEvents << endl;
// Loop over events
for (Int_t i=0; i<nEvents; i++) {
t->getEvent(i);
// Apply gain correction factors
t->ScintE.q1 = t->ScintE.q1*gainCorrection[0];
t->ScintE.q2 = t->ScintE.q2*gainCorrection[1];
t->ScintE.q3 = t->ScintE.q3*gainCorrection[2];
t->ScintE.q4 = t->ScintE.q4*gainCorrection[3];
t->ScintW.q1 = t->ScintW.q1*gainCorrection[4];
t->ScintW.q2 = t->ScintW.q2*gainCorrection[5];
t->ScintW.q3 = t->ScintW.q3*gainCorrection[6];
t->ScintW.q4 = t->ScintW.q4*gainCorrection[7];
t->fillOutputTree();
}
// Write output ntuple
t->writeOutputFile();
delete t;
return 0;
}