using namespace std;
#include "hhypAllProjector.h"
using namespace std;
ClassImp(HHypAllProjector)
HHypAllProjector::HHypAllProjector(Char_t *name_i, Option_t par[])
:HHypBaseAlgorithm(name_i,par)
{
}
HHypAllProjector::~HHypAllProjector()
{
}
Bool_t HHypAllProjector::execute()
{
Int_t npart;
Int_t src[HYP_MAX_PARTICLES];
npart=mylist->getNpart();
if(npart>HYP_MAX_PARTICLES) return kFALSE;
mylist->CombIteratorReset();
while (mylist->CombIterator()) {
Int_t creation;
Int_t dummy;
Float_t event_genweight;
event_genweight=1.0;
npart=mylist->getNvalid();
for(Int_t i=0; i<npart; i++){
pidofPart[i]=mylist->getPid(i);
momentum[i]=mylist->getMomentum(i);
creation=0;
if(simuflag && CatTrackCandSim){
HPidTrackCandSim *my = (HPidTrackCandSim *)
CatTrackCandSim->getObject(mylist->getIdxPidTrackCand(i));
if ((my != NULL) && (mylist->getIterStatus() == kTRUE)) {
HPidGeantTrackSet *GeantSet = my->getGeantTrackSet();
Int_t geant_track = GeantSet->getGeantTrackID(0);
if (geant_track >= 0) {
Float_t genweight, dummy2;
HGeantKine *geantkine =
(HGeantKine *) GeantSet->getGeantKine(geant_track);
geantkine->getCreator(dummy,dummy,creation);
geantkine->getGenerator(dummy2, genweight);
if(genweight>0.0) event_genweight=genweight;
}
}
}
src[i]=creation;
}
Float_t fakes;
fakes=mylist->getNrOfFakes();
Float_t mpid;
if (!mylist->getUserValue(FILLER_MISSING_PID, mpid)) mpid = -999;
Float_t chi2;
if (!mylist->getUserValue(KINEFIT_CHI2, chi2)) chi2 = -1;
Float_t channel_code_lo;
if (!mylist->getUserValue(KINEFIT_CHANNEL_LO, channel_code_lo)) channel_code_lo = -1;
Float_t channel_code_hi;
if (!mylist->getUserValue(KINEFIT_CHANNEL_HI, channel_code_hi)) channel_code_hi = -1;
Float_t dtof, dtof2, dtof_chi2, dtof_offset;
if (!mylist->getUserValue(DELTATOF_DTOF, dtof)) dtof = -1;
if (!mylist->getUserValue(DELTATOF_DTOF2, dtof2)) dtof2 = -1;
if (!mylist->getUserValue(DELTATOF_CHI2, dtof_chi2)) dtof_chi2 = -1;
if (!mylist->getUserValue(DELTATOF_OFFSET, dtof_offset)) dtof_offset = -1;
if (histofile) {
Float_t tmp[10+HYP_MAX_PARTICLES*5];
Int_t ii;
ii=0;
tmp[ii++]=chi2;
tmp[ii++]=channel_code_lo;
tmp[ii++]=channel_code_hi;
tmp[ii++]=mpid;
tmp[ii++]=fakes;
tmp[ii++]=dtof;
tmp[ii++]=dtof2;
tmp[ii++]=dtof_chi2;
tmp[ii++]=dtof_offset;
tmp[ii++]=event_genweight;
for(Int_t i=0; i<npart; i++){
tmp[ii++]=pidofPart[i];
tmp[ii++]=momentum[i].Px();
tmp[ii++]=momentum[i].Py();
tmp[ii++]=momentum[i].Pz();
tmp[ii++]=src[i];
}
for(Int_t i=npart; i<HYP_MAX_PARTICLES; i++){
tmp[ii++]=0;
tmp[ii++]=0;
tmp[ii++]=0;
tmp[ii++]=0;
}
qa->Fill(tmp);
}
}
if (exitIdx > -1)
return kTRUE;
return kFALSE;
}
Bool_t HHypAllProjector::init()
{
TString input(channel->Get(initList));
simCat = gHades->getCurrentEvent()->getCategory(catGeantKine);
CatTrackCandSim = NULL;
if (!simCat){
simuflag = 0;
}else{
simuflag = 1;
if ((CatTrackCandSim =
gHades->getCurrentEvent()->getCategory(catPidTrackCand)) == NULL) {
Error("init", "Cannot get catPidTrackCandSim cat");
return kFALSE;
}
}
if (histofile){
TString tmpstr(
"chi2:channel_code_lo:channel_code_hi:miss_pid:fakes"
":dtof_dtof:dtof_dtof2:dtof_chi2:dtof_offset:weight");
for(Int_t i=0; i<HYP_MAX_PARTICLES; i++) {
Char_t tmp2[30];
sprintf(tmp2,":pid%d:px_%d:py_%d:pz_%d:src_%d",i,i,i,i,i);
tmpstr+=tmp2;
}
cout << "*********"<< tmpstr <<"*********"<< endl;
qa = new TNtuple(input + TString("_all_proj"), "project all", tmpstr);
}
return kTRUE;
}
Bool_t HHypAllProjector::reinit()
{
return kTRUE;
}
Bool_t HHypAllProjector::finalize()
{
if (histofile) qa->Write();
return kTRUE;
}
Last change: Sat May 22 12:57:40 2010
Last generated: 2010-05-22 12:57
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.