Selector for generic processing with stdlib collections.
#define ProofStdVect_cxx
ProofStdVect::ProofStdVect()
{
fTree = 0;
fFile = 0;
fProofFile = 0;
fRandom = 0;
fHgood = 0;
fHbad = 0;
}
ProofStdVect::~ProofStdVect()
{
}
{
if (fInput && fInput->FindObject("ProofStdVect_Create")) {
}
}
void ProofStdVect::SlaveBegin(
TTree * )
{
if (fInput && fInput->FindObject("ProofStdVect_Create")) {
}
if (fCreate) {
fFile = fProofFile->OpenFile("RECREATE");
if (fFile && fFile->IsZombie())
SafeDelete(fFile);
if (!fFile) {
Info(
"SlaveBegin",
"could not create '%s': instance is invalid!", fProofFile->GetName());
return;
}
fTree =
new TTree(
"stdvec",
"Tree with std vector");
fTree->Branch("Vb",&fVb);
fTree->Branch("Vfx",&fVfx);
fTree->Branch("Vfy",&fVfy);
fTree->SetDirectory(fFile);
fTree->AutoSave();
} else {
fHgood =
new TH1F(
"Hgood",
"Good hits", 100., -2.5, 2.5);
fHbad =
new TH1F(
"Hbad",
"Bad hits", 100., -6., 6.);
fOutput->Add(fHgood);
fOutput->Add(fHbad);
}
}
{
if (fCreate) {
if (!fTree)
return kTRUE;
if (nv < 1) nv = 1;
for (
Int_t i = 0; i < nv; i++) {
std::vector<bool> vb;
std::vector<float> vfx, vfy;
if (np < 1) np = 1;
for (
Int_t j = 0; j < np; j++) {
vb.push_back(xb);
vfy.push_back(float(ym));
}
fVb.push_back(vb);
fVfx.push_back(vfx);
fVfy.push_back(vfy);
}
fTree->Fill();
std::vector<std::vector<bool> >::iterator ivb;
for (ivb = fVb.begin(); ivb != fVb.end(); ivb++) {
(*ivb).clear();
}
fVb.clear();
std::vector<std::vector<float> >::iterator ivf;
for (ivf = fVfx.begin(); ivf != fVfx.end(); ivf++) {
(*ivf).clear();
}
fVfx.clear();
for (ivf = fVfy.begin(); ivf != fVfy.end(); ivf++) {
(*ivf).clear();
}
fVfy.clear();
} else {
GetEntry(entry);
for (
UInt_t i = 0; i < fVfyr->size(); i++) {
std::vector<bool> &vb = fVbr->at(i);
std::vector<float> &vfx = fVfxr->at(i);
std::vector<float> &vfy = fVfyr->at(i);
for (
UInt_t j = 0; j < vfy.size(); j++) {
Double_t ny = (vfy.at(j) - 5*vfx.at(j)) / (0.1 * 5 * vfx.at(j));
if (vb.at(j) < 0.5)
fHbad->Fill(ny);
else
fHgood->Fill(ny);
}
}
}
}
void ProofStdVect::SlaveTerminate()
{
if (!fCreate) return;
if (fFile) {
if (!fTree) {
Error(
"SlaveTerminate",
"'tree' is undefined!");
return;
}
if (fTree->GetEntries() > 0) {
fFile->cd();
fTree->Write();
fProofFile->Print();
fOutput->Add(fProofFile);
} else {
}
fTree->SetDirectory(0);
fFile->Close();
if (cleanup) {
TUrl uf(*(fFile->GetEndpointUrl()));
}
}
}
void ProofStdVect::Terminate()
{
if (fCreate) return;
if (fHbad) fHbad->
Draw();
if (fHgood) fHgood->
Draw();
}
{
if (fCreate) return;
fVbr = 0;
fVfxr = 0;
fVfyr = 0;
fChain->SetMakeClass(1);
fChain->SetBranchAddress("Vb", &fVbr, &b_Vb);
fChain->SetBranchAddress("Vfx", &fVfxr, &b_Vfx);
fChain->SetBranchAddress("Vfy", &fVfyr, &b_Vfy);
}
{
if (fCreate)
return kTRUE;
Info(
"Notify",
"processing file: %s",fChain->GetCurrentFile()->GetName());
}
Selector for generic processing with stdlib collections.
void Info(const char *location, const char *msgfmt,...)
void Error(const char *location, const char *msgfmt,...)
R__EXTERN TSystem * gSystem
1-D histogram with a float per channel (see TH1 documentation)}
The most important graphics class in the ROOT system.
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
Class to steer the merging of files produced on the workers.
Random number generator class based on M.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
virtual int Unlink(const char *name)
Unlink, i.e.
A TTree represents a columnar dataset.
This class represents a WWW compatible URL.
virtual void Draw(Option_t *option="")=0
Default Draw method for all objects.
void Init(TClassEdit::TInterpreterLookupHelper *helper)
Double_t Erfc(Double_t x)
Compute the complementary error function erfc(x).
Double_t Sqrt(Double_t x)