by Pedro Mercadante - Last update on 15-Dec-2005
How To Make a Processor and Access the Data via Cafe
On d0server copy the following files to your work directory:
/home/mercadan/Analises/cafe/zpeak/AddProcessor.sh
/home/mercadan/Analises/cafe/zpeak/TClass.cpp
/home/mercadan/Analises/cafe/zpeak/TClass.hpp
/home/mercadan/Analises/cafe/zpeak/TClass_linkdef.h
/home/mercadan/Analises/cafe/zpeak/TClass_t.cpp
Execute:
./AddProcessor.sh inv_mass InvMass
The first argument is the package name and the second is the processor name. The AddProcessor.sh creates all the necessary .cpp, .hpp and linkdef.h. We should edit the inv_mass/src/InvMass.cpp. Basically in InvMass::begin() we initialize the histograms; in InvMass::processEvent(cafe::Event& event) we process events, do whatever we need and fill the histograms; and in InvMass::finish() we write the histograms.
To access the data we should look at
http://www-d0.fnal.gov/Run2Physics/working_group/data_format/caf/
under the class list.
We can click on cafe::Event and see all the objects.
For exemple getEMscone is a Collection
Collection
for(Collection
it = fro.end(); ++it)
Now we can access all objects defined in the class TMBEMCluster. For example, Px, Py, Pz:
float ele_pt = it->Pt() ;
float ele_px = it->Px() ;
float ele_py = it->Py() ;
float ele_pz = it->Pz() ;
float ele_E = it->E() ;
One note for the histograms: we define the histograms in the InvMass::begin() function and fill in the bool InvMass::processEvent(cafe::Event& event) function. So don't forget to declare the global variables in the .hpp file.
antalya escort bursa escort eskisehir escort istanbul escort izmir escort