本文整理汇总了C++中DataTree::writeOutputFile方法的典型用法代码示例。如果您正苦于以下问题:C++ DataTree::writeOutputFile方法的具体用法?C++ DataTree::writeOutputFile怎么用?C++ DataTree::writeOutputFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataTree
的用法示例。
在下文中一共展示了DataTree::writeOutputFile方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
t->yW.err = 0.;
t->yW.rawCenter = 0.;
t->ScintE.q1 = pmt[0];
t->ScintE.q2 = pmt[1];
t->ScintE.q3 = pmt[2];
t->ScintE.q4 = pmt[3];
t->ScintE.e1=t->ScintE.de1=t->ScintE.e2=t->ScintE.de2=t->ScintE.e3=t->ScintE.de3=t->ScintE.e4=t->ScintE.de4=0.;
t->ScintE.energy=t->ScintE.denergy=0.;
t->ScintE.nPE1=t->ScintE.nPE2=t->ScintE.nPE3=t->ScintE.nPE4=0.;
t->ScintW.q1 = pmt[4];
t->ScintW.q2 = pmt[5];
t->ScintW.q3 = pmt[6];
t->ScintW.q4 = pmt[7];
t->ScintW.e1=t->ScintW.de1=t->ScintW.e2=t->ScintW.de2=t->ScintW.e3=t->ScintW.de3=t->ScintW.e4=t->ScintW.de4=0.;
t->ScintW.energy=t->ScintW.denergy=0.;
t->ScintW.nPE1=t->ScintW.nPE2=t->ScintW.nPE3=t->ScintW.nPE4=0.;
t->ScintE_bare.q1 = pmt[0];
t->ScintE_bare.q2 = pmt[1];
t->ScintE_bare.q3 = pmt[2];
t->ScintE_bare.q4 = pmt[3];
t->ScintE_bare.e1=t->ScintE_bare.de1=t->ScintE_bare.e2=t->ScintE_bare.de2=t->ScintE_bare.e3=t->ScintE_bare.de3=t->ScintE_bare.e4=t->ScintE_bare.de4=0.;
t->ScintE_bare.energy=t->ScintE_bare.denergy=0.;
t->ScintE_bare.nPE1=t->ScintE_bare.nPE2=t->ScintE_bare.nPE3=t->ScintE_bare.nPE4=0.;
t->ScintW_bare.q1 = pmt[4];
t->ScintW_bare.q2 = pmt[5];
t->ScintW_bare.q3 = pmt[6];
t->ScintW_bare.q4 = pmt[7];
t->ScintW_bare.e1=t->ScintW_bare.de1=t->ScintW_bare.e2=t->ScintW_bare.de2=t->ScintW_bare.e3=t->ScintW_bare.de3=t->ScintW_bare.e4=t->ScintW_bare.de4=0.;
t->ScintW_bare.energy=t->ScintW_bare.denergy=0.;
t->ScintW_bare.nPE1=t->ScintW_bare.nPE2=t->ScintW_bare.nPE3=t->ScintW_bare.nPE4=0.;
t->EvisE = t->EvisW = 0.;
t->CathSumE = t->xE.cathSum+t->yE.cathSum;
t->CathSumW = t->xW.cathSum+t->yW.cathSum;
t->CathMaxE = (t->xE.maxValue>t->yE.maxValue)?t->yE.maxValue:t->xE.maxValue;
t->CathMaxW = (t->xW.maxValue>t->yW.maxValue)?t->yW.maxValue:t->xW.maxValue;
t->EMWPC_E = t->EMWPC_W = 0.;
t->AnodeE = AnodeE; // Pedestal subtracted
t->AnodeW = AnodeW;
t->EvnbGood = t->BkhfGood = true;
for (Int_t i = 0; i<5; i++) {
if ((int)Evnb[i]-t->TriggerNum) t->EvnbGood = false;
if ((int)Bkhf[i]!=17) t->BkhfGood = false;
}
t->xeRC = xeRC;
t->yeRC = yeRC;
t->xwRC = xwRC;
t->ywRC = ywRC;
t->PID = PID;
t->Type = type;
t->Side = side;
t->ProbIII = 0.;
t->Erecon = 0.;
t->Erecon_ee = 0.;
t->old_Erecon = 0.;
t->gaus_Erecon = 0.;
/*timeE_BB = Clk2*scalerCountsToTime;
timeW_BB = Clk3*scalerCountsToTime;
UBtime = S83028*scalerCountsToTime;
UBtime_BB = S8200*scalerCountsToTime;
twoFoldE = Tdc016;
twoFoldW = Tdc017;*/
t->fillOutputTree();
}
fileIn->Close();
// Write output ntuple
t->writeOutputFile();
delete t;
if ( checkIfReplayFileIsGood(std::string(tempOut)) != 1 ) {
std::ofstream badRuns("badRuns.txt", std::fstream::app);
badRuns << argv[1] << "\n";
badRuns.close();
}
return 0;
}
示例2: main
//.........这里部分代码省略.........
t.xW.cathSum = xMWPCWestSum;
t.xW.maxValue = xWmax;
t.xW.maxWire = xWmaxWire;
t.xW.mult = xWmult;
t.xW.nClipped = 0;
t.xW.err = 0.;
t.xW.rawCenter = 0.;
t.xW.height = 0.;
t.yW.center = yW;
t.yW.width = 0.;
t.yW.cathSum = yMWPCWestSum;
t.yW.maxValue = yWmax;
t.yW.maxWire = yWmaxWire;
t.yW.mult = yWmult;
t.yW.nClipped = 0;
t.yW.err = 0.;
t.yW.rawCenter = 0.;
t.yW.height = 0.;
t.ScintE.q1 = pmt[0];
t.ScintE.q2 = pmt[1];
t.ScintE.q3 = pmt[2];
t.ScintE.q4 = pmt[3];
t.ScintE.e1=t.ScintE.de1=t.ScintE.e2=t.ScintE.de2=t.ScintE.e3=t.ScintE.de3=t.ScintE.e4=t.ScintE.de4=0.;
t.ScintE.energy=t.ScintE.denergy=0.;
t.ScintE.nPE1=t.ScintE.nPE2=t.ScintE.nPE3=t.ScintE.nPE4=0.;
t.ScintW.q1 = pmt[4];
t.ScintW.q2 = pmt[5];
t.ScintW.q3 = pmt[6];
t.ScintW.q4 = pmt[7];
t.ScintW.e1=t.ScintW.de1=t.ScintW.e2=t.ScintW.de2=t.ScintW.e3=t.ScintW.de3=t.ScintW.e4=t.ScintW.de4=0.;
t.ScintW.energy=t.ScintW.denergy=0.;
t.ScintW.nPE1=t.ScintW.nPE2=t.ScintW.nPE3=t.ScintW.nPE4=0.;
t.EvisE = t.EvisW = 0.;
t.CathSumE = t.xE.cathSum+t.yE.cathSum;
t.CathSumW = t.xW.cathSum+t.yW.cathSum;
t.CathMaxE = (t.xE.maxValue>t.yE.maxValue)?t.yE.maxValue:t.xE.maxValue;
t.CathMaxW = (t.xW.maxValue>t.yW.maxValue)?t.yW.maxValue:t.xW.maxValue;
t.EMWPC_E = t.EMWPC_W = 0.;
t.AnodeE = (double) Pdc30;
t.AnodeW = (double) Pdc34;
t.PassedCathE = t.PassedCathW = PID==1?true:false; //temporary holder for this
t.EvnbGood = t.BkhfGood = true;
for (Int_t i = 0; i<5; i++) {
if ((int)Evnb[i]-t.TriggerNum) t.EvnbGood = false;
if ((int)Bkhf[i]!=17) t.BkhfGood = false;
}
t.xeRC = xeRC;
t.yeRC = yeRC;
t.xwRC = xwRC;
t.ywRC = ywRC;
t.PID = PID;
t.Type = type;
t.Side = side;
t.ProbIII = 0.;
t.Erecon = 0.;
/*timeE_BB = Clk2*scalerCountsToTime;
timeW_BB = Clk3*scalerCountsToTime;
UBtime = S83028*scalerCountsToTime;
UBtime_BB = S8200*scalerCountsToTime;
twoFoldE = Tdc016;
twoFoldW = Tdc017;*/
t.fillOutputTree();
}
fileIn->Close();
//Now I want to create and store a few pertinent values in a file for later...
char tempFile[200];
sprintf(tempFile,"%s/runInfo_%s.dat",getenv("RUN_INFO_FILES"),argv[1]);
ofstream runInfo(tempFile);
std::cout << "Writing Info to " << tempFile << std::endl;
runInfo << "RunLengthEast\t" << std::setprecision(9) << runLengthBlind[0] << std::endl;
runInfo << "RunLengthWest\t" << std::setprecision(9) << runLengthBlind[1] << std::endl;
runInfo << "RunLengthTrue\t" << std::setprecision(9) << runLengthTrue << std::endl;
runInfo << "UCNMon4Integral\t" << std::setprecision(9) << t.UCN_Mon_4_Rate->Integral("width");
runInfo.close();
// Write output ntuple
t.writeOutputFile();
//fileOut->Close();
return 0;
}
示例3: main
//.........这里部分代码省略.........
//std::cout << "Made it here" << std::endl;
//Calculate the weighted energy on a side
//EAST
double numer = 0.;
numer = ( (pmtQuality[0] ? t->ScintE.nPE1 : 0.) +
(pmtQuality[1] ? t->ScintE.nPE2 : 0.) +
(pmtQuality[2] ? t->ScintE.nPE3 : 0.) +
(pmtQuality[3] ? t->ScintE.nPE4 : 0.) );
double denom = 0.;
denom = ( (pmtQuality[0] ? alpha[0] * eta[0] : 0.) +
(pmtQuality[1] ? alpha[1] * eta[1] : 0.) +
(pmtQuality[2] ? alpha[2] * eta[2] : 0.) +
(pmtQuality[3] ? alpha[3] * eta[3] : 0.) );
t->ScintE.energy = t->EvisE = (denom!=0. ? numer/denom : 0.);
t->ScintE.denergy = (denom!=0. ? sqrt(t->ScintE.energy/denom) : 0.);
//WEST
numer = denom = 0.;
numer = ( (pmtQuality[4] ? t->ScintW.nPE1 : 0.) +
(pmtQuality[5] ? t->ScintW.nPE2 : 0.) +
(pmtQuality[6] ? t->ScintW.nPE3 : 0.) +
(pmtQuality[7] ? t->ScintW.nPE4 : 0.) );
denom = ( (pmtQuality[4] ? alpha[4] * eta[4] : 0.) +
(pmtQuality[5] ? alpha[5] * eta[5] : 0.) +
(pmtQuality[6] ? alpha[6] * eta[6] : 0.) +
(pmtQuality[7] ? alpha[7] * eta[7] : 0.) );
t->ScintW.energy = t->EvisW = (denom!=0. ? numer/denom : 0.);
t->ScintW.denergy = (denom!=0. ? sqrt(t->ScintW.energy/denom) : 0.);
// Determine the reconstructed energy
Int_t typeIndex = 0; //for retrieving the parameters from EQ2Etrue
if (t->Side==0) {
if (t->EvisE>0.) {
t->Erecon = eRecon.getErecon(0,typeIndex,t->EvisE);
}
else t->Erecon=-1.;
}
if (t->Side==1) {
if (t->EvisW>0.) {
t->Erecon = eRecon.getErecon(1,typeIndex,t->EvisW);
}
else t->Erecon=-1.;
}
}
// Last thing to do for electrons is position correct the anode signal and
// apply the wirechamber energy calibration
// Get the position response
std::vector <Double_t> etaMWPC = anodeMap.getInterpolatedEta(t->xE.center,t->yE.center,
t->xW.center,t->yW.center);
t->AnodeE = t->AnodeE / etaMWPC[0];
t->AnodeW = t->AnodeW / etaMWPC[1];
t->EMWPC_E = mwpcCal.applyCal( 0, t->AnodeE ) ;
t->EMWPC_W = mwpcCal.applyCal( 1, t->AnodeW ) ;
// write out pedestal subtracted cathode values for all events
for ( int ii = 0; ii<16; ++ii ) {
t->Cathodes_Ex[ii] = t->Cathodes_Ex[ii] - pedPdc2[ii+16];
t->Cathodes_Ey[ii] = t->Cathodes_Ey[ii] - pedPdc2[ii];
t->Cathodes_Wx[ii] = t->Cathodes_Wx[ii] - pedPadc[ii+16];
t->Cathodes_Wy[ii] = t->Cathodes_Wy[ii] - pedPadc[ii];
}
t->fillOutputTree();
}
// Write output ntuple
t->writeOutputFile();
delete t; //Closes files
if ( checkIfReplayFileIsGood(std::string(tempOut)) != 1 ) {
std::ofstream badRuns("badRuns.txt", std::fstream::app);
badRuns << argv[1] << "\n";
badRuns.close();
}
return 0;
}
示例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;
}