00001
00002
00003
00004
00005
00006
00007
00008
00009
00011
00012 #include <fstream>
00013 #include "AlephExManager.h"
00014 #include "AlephCollection.h"
00015 #include <vector>
00016 #include "AlToolBox.h"
00017 #include "AlBjet.h"
00018
00019 extern ofstream fout;
00020
00022
00024
00025 static float mZ = 91.1882;
00026
00027 void AlephExManager::UserInit()
00028 {
00029 int i;
00030 float f;
00031 theNtupleWriter()->AddOutput(f,"x");
00032 theNtupleWriter()->AddOutput(f,"y");
00033 theNtupleWriter()->AddOutput(f,"z");
00034 theNtupleWriter()->AddOutput(f,"MCx");
00035 theNtupleWriter()->AddOutput(f,"MCy");
00036 theNtupleWriter()->AddOutput(f,"MCz");
00037 theNtupleWriter()->AddOutput(f,"EventPb");
00038 theNtupleWriter()->AddOutput(i,"nJets");
00039 theNtupleWriter()->AddOutput(f,"JetPb");
00040 }
00041
00044
00046
00048
00049 {
00050 cerr << ".";
00051
00052
00053 AlephCollection<AlVertex *> alMCvtp=EventInfo.MCverticesPV();
00054
00055 AlVertex* alMainV=EventInfo.MainVertexP();
00056
00057 theNtupleWriter()->Keep("x", alMainV->QX());
00058 theNtupleWriter()->Keep("y", alMainV->QY());
00059 theNtupleWriter()->Keep("z", alMainV->QZ());
00060 theNtupleWriter()->Keep("MCx",alMCvtp[0]->QX());
00061 theNtupleWriter()->Keep("MCy",alMCvtp[0]->QY());
00062 theNtupleWriter()->Keep("MCz",alMCvtp[0]->QZ());
00063
00064
00065 AlToolBox myToolBox;
00066
00067 pair<AlephCollection<AlBjet>,vector<float> > output = myToolBox.TagBjets(&EventInfo);
00068
00069 theNtupleWriter()->Keep("EventPb", output.second[EventInfo.TrackV().size()]);
00070
00071 theNtupleWriter()->Keep("nJets", output.first.size());
00072
00073
00074 vector<float> values;
00075 for(AlephCollection<AlBjet>::iterator bjet_i=output.first.begin();bjet_i<output.first.end();bjet_i++)
00076 values.push_back(bjet_i->getBprobability());
00077
00078 float proba = ( values.size() ? (*min_element(values.begin(),values.end())) : 1);
00079 theNtupleWriter()->Keep("JetPb", proba);
00080
00081 theNtupleWriter()->Fill();
00082 return true;
00083 }
00084
00087
00089
00091