// Author: Edward Brash February 15, 2005 // // // MyProcessor.cc // #include using namespace std; #include #include "MyProcessor.h" #include "hddm_s.h" #include "DBCALHit.h" #include "DCDCHit.h" #include "DCHERENKOVHit.h" #include "DFCALHit.h" #include "DFDCHit.h" #include "DTAGGERHit.h" #include "DTOFHit.h" #include "DUPVHit.h" #include "DTrackCandidate.h" #include "DQuickFit.h" #include "DTrackFit.h" #include "DMCThrown.h" //------------------------------------------------------------------ // init -Open output file here (e.g. a ROOT file) //------------------------------------------------------------------ derror_t MyProcessor::init(void) { // open ROOT file ROOTfile = new TFile("hd_tree.root","RECREATE","Produced by hd_root"); cout<<"Opened ROOT file \"hd_tree.root\" ..."<Branch("CDCHits","CDCHitCopy",&ROOTcdchit); cout<<"Created CDCHits Branch ..."<Branch("FCALHits","FCALHitCopy",&ROOTfcalhit); cout<<"Created FCALHits Branch ..."< cdchits; vector fcalhits; eventLoop->Get(cdchits); eventLoop->Get(fcalhits); for(unsigned int i=0;ix=cdchit->radius*cos(cdchit->phim); ROOTcdchit->y = cdchit->radius*sin(cdchit->phim); ROOTcdchit->radius = cdchit->radius; ROOTcdchit->phim = cdchit->phim; ROOTcdchit->dE=cdchit->dE; ROOTcdchit->t=cdchit->t; ROOTtree->Fill(); } for(unsigned int i=0;ix=fcalhit->y; ROOTfcalhit->y=fcalhit->y; ROOTfcalhit->E=fcalhit->E; ROOTfcalhit->t=fcalhit->t; ROOTtree->Fill(); } eventLoop->PrintRate(); #endif return NOERROR; } //------------------------------------------------------------------ // fini -Close output file here //------------------------------------------------------------------ derror_t MyProcessor::fini(void) { ROOTfile->Write(); delete ROOTfile; cout<