///////////////////////////////////////////////////////////////////// // // Vertex package test routines // // Author : C. Delaere // // Date: 2001-08-08 // // ///////////////////////////////////////////////////////////////////// #include #include "AlephExManager.h" #include "AlephCollection.h" #include #include "AlToolBox.h" #include "AlBjet.h" extern ofstream fout; /////////////////////////////////////////////////////////////////////// // User Init /////////////////////////////////////////////////////////////////////// static float mZ = 91.1882; // RPP2000 void AlephExManager::UserInit() { int i; float f; theNtupleWriter()->AddOutput(f,"x"); theNtupleWriter()->AddOutput(f,"y"); theNtupleWriter()->AddOutput(f,"z"); theNtupleWriter()->AddOutput(f,"MCx"); theNtupleWriter()->AddOutput(f,"MCy"); theNtupleWriter()->AddOutput(f,"MCz"); theNtupleWriter()->AddOutput(f,"EventPb"); theNtupleWriter()->AddOutput(i,"nJets"); theNtupleWriter()->AddOutput(f,"JetPb"); } /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // User Event /////////////////////////////////////////////////////////////////////// void AlephExManager::UserEvent(AlphaBanks& EventInfo) { cerr << "."; // get pointers to the objects used in the analysis // Collection of pointers the the MC vertices AlephCollection alMCvtp=EventInfo.MCverticesPV(); // The reconstructed main vertex AlVertex* alMainV=EventInfo.MainVertexP(); // keep the values (in the output ntuple) theNtupleWriter()->Keep("x", alMainV->QX()); theNtupleWriter()->Keep("y", alMainV->QY()); theNtupleWriter()->Keep("z", alMainV->QZ()); theNtupleWriter()->Keep("MCx",alMCvtp[0]->QX()); theNtupleWriter()->Keep("MCy",alMCvtp[0]->QY()); theNtupleWriter()->Keep("MCz",alMCvtp[0]->QZ()); // Produce B-Jets using the QIPBTAG algorithm // instanciate the toolbox AlToolBox myToolBox; // call the QIPBTAG-like method pair,vector > output = myToolBox.TagBjets(&EventInfo); // keep the event probability (in the output ntuple) theNtupleWriter()->Keep("EventPb", output.second[EventInfo.TrackV().size()]); // keep the number of jets produced theNtupleWriter()->Keep("nJets", output.first.size()); // compute the maximum B-Jet probability // extract the vector of probabilities vector values; for(AlephCollection::iterator bjet_i=output.first.begin();bjet_igetBprobability()); // keep the biggest B probability (min value) float proba = ( values.size() ? (*min_element(values.begin(),values.end())) : 1); theNtupleWriter()->Keep("JetPb", proba); // the event is valid, so fill the ntuple (the tree) theNtupleWriter()->Fill(); } /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // User Term /////////////////////////////////////////////////////////////////////// void AlephExManager::UserTerm() {}