Index: FlatNtuple/FlatNtuple/UCNtupleModule.hh =================================================================== RCS file: /cdf/code/cdfcvs/run2/FlatNtuple/FlatNtuple/UCNtupleModule.hh,v retrieving revision 1.2 diff -b -y -r1.2 UCNtupleModule.hh #ifndef UCNTUPLE_HH #ifndef UCNTUPLE_HH #define UCNTUPLE_HH #define UCNTUPLE_HH #include "RootMods/RootHistModule.hh" #include "RootMods/RootHistModule.hh" #include "TTree.h" #include "TTree.h" // // #include "Framework/AbsParmGeneral.hh" #include "Framework/AbsParmGeneral.hh" #include "TrackingObjects/Storable/CdfTrackView.hh" #include "TrackingObjects/Storable/CdfTrackView.hh" #include "Level3Filters/L3BeamSpot.hh" #include "Level3Filters/L3BeamSpot.hh" #include "Level3Filters/COT2SVTMatch.hh" #include "Level3Filters/COT2SVTMatch.hh" #include "TrackingSI/Utils/SiExpected.hh" #include "TrackingSI/Utils/SiExpected.hh" #include "JetObjects/CdfJetColl.hh" #include "JetObjects/CdfJetColl.hh" // The following will propagate to all blocks // The following will propagate to all blocks #if defined( IRIX6 ) #if defined( IRIX6 ) #include #include #endif #endif class PhysicsTowerDataMaker; class PhysicsTowerDataMaker; class TriggerMap; class TriggerMap; class CotBeam; class CotBeam; class SvxBeam; class SvxBeam; class RunSummary; class RunSummary; #include "myheader_t.hh" #include "myheader_t.hh" #include "myvertex_t.hh" #include "myvertex_t.hh" #include "myphoton_t.hh" #include "myphoton_t.hh" #include "mytrigger_t.hh" #include "mytrigger_t.hh" #include "mymet_t.hh" #include "mymet_t.hh" #include "myjet_t.hh" #include "myjet_t.hh" #include "myelectron_t.hh" #include "myelectron_t.hh" #include "mytrack_t.hh" #include "mytrack_t.hh" #include "mytagging_t.hh" #include "mytagging_t.hh" #include "mymuon_t.hh" #include "mymuon_t.hh" #include "mytau_t.hh" #include "mytau_t.hh" #include "myobsp_t.hh" #include "myobsp_t.hh" #include "myobsv_t.hh" #include "myobsv_t.hh" #include "myhepg_t.hh" #include "myhepg_t.hh" #include "mysvt_t.hh" #include "mysvt_t.hh" #include "myxtrp_t.hh" #include "myxtrp_t.hh" #include "myzbb_t.hh" #include "myzbb_t.hh" #include "mycaltrigger_t.hh" #include "mycaltrigger_t.hh" #include "mylevel3_t.hh" #include "mylevel3_t.hh" class UCNtupleModule : public RootHistModule { class UCNtupleModule : public RootHistModule { //-------------------- //-------------------- // Instance Members -- // Instance Members -- //-------------------- //-------------------- public: public: // Constructors // Constructors UCNtupleModule( const char* const theName = "UCNtupleModule UCNtupleModule( const char* const theName = "UCNtupleModule const char* const theDescription = "UC Ntuple ver const char* const theDescription = "UC Ntuple ver // Destructor // Destructor virtual ~UCNtupleModule( ); virtual ~UCNtupleModule( ); // Operations // Operations virtual AppResult beginJob( AbsEvent* aJob ); virtual AppResult beginJob( AbsEvent* aJob ); virtual AppResult beginRun( AbsEvent* aRun ); virtual AppResult beginRun( AbsEvent* aRun ); virtual AppResult event( AbsEvent* event ); virtual AppResult event( AbsEvent* event ); virtual AppResult endJob(AbsEvent* aJob); virtual AppResult endJob(AbsEvent* aJob); virtual AppModule* clone( const char* cloneName ); virtual AppModule* clone( const char* cloneName ); const char* rcsId( ) const; const char* rcsId( ) const; static const Int_t NTVERSION = 59711; static const Int_t NTVERSION = 59711; // 59711: Fix Zbb declaration problem; bring muon and elect // 59711: Fix Zbb declaration problem; bring muon and elect // into substantial compliance with ewk group cuts; // into substantial compliance with ewk group cuts; // CosmicFinderModule bitword; add et out of time fr // CosmicFinderModule bitword; add et out of time fr // CosmicRayInfo; add ntracksinit variable for photo // CosmicRayInfo; add ntracksinit variable for photo // 59710: Fix jet-met problem; fix beamlines for monte carl // 59710: Fix jet-met problem; fix beamlines for monte carl // 59709: fix level 3 trigger bank to deal with changes in // 59709: fix level 3 trigger bank to deal with changes in // 59708: Add ability to use vertex closest to highest-pt g // 59708: Add ability to use vertex closest to highest-pt g // event vertex // event vertex // 59707: Fix jet-to-track link slowness; add new Level3 bl // 59707: Fix jet-to-track link slowness; add new Level3 bl // add Beate's (major) fixes to get correct calorime // add Beate's (major) fixes to get correct calorime // 59706: Fix zbb block multi-creation bug, let jet2 roam f // 59706: Fix zbb block multi-creation bug, let jet2 roam f // jet troubles from terminating jet2 creation, incl // jet troubles from terminating jet2 creation, incl // info in track block, update to 4.9.1_v02 tags for // info in track block, update to 4.9.1_v02 tags for // include track-to-jet links, fix zbb block orderin // include track-to-jet links, fix zbb block orderin // 59705: Fix track isolation computation bug // 59705: Fix track isolation computation bug // 59704: Add 4.9.1 track refits // 59704: Add 4.9.1 track refits // 59703: Add CMIO corrections to met block // 59703: Add CMIO corrections to met block // 59702: Update to 4.9.1 // 59702: Update to 4.9.1 // 59701: Fix bug in jetTracksDefault HLO routine // 59701: Fix bug in jetTracksDefault HLO routine // 59700: Z->bbbar group blocks merge; fix so empty events // 59700: Z->bbbar group blocks merge; fix so empty events // crashes in met computation // crashes in met computation // 59601: Fix bug in eastbhocc beam halo variable // 59601: Fix bug in eastbhocc beam halo variable // 59600: Add stubless muons; add "official" fidele informa // 59600: Add stubless muons; add "official" fidele informa // initial track-pointing-at-photon information; ele // initial track-pointing-at-photon information; ele // cross-reference; per-superlayer track hit count b // cross-reference; per-superlayer track hit count b // photon-to-jet cross-reference; // photon-to-jet cross-reference; // changes in photon timing code; add COT-only infor // changes in photon timing code; add COT-only infor // add dof count for tracks; add small corrections t // add dof count for tracks; add small corrections t // and delta z; add ces chisq fix for electrons; cha // and delta z; add ces chisq fix for electrons; cha // energies to two-tower sums; fix significant muon // energies to two-tower sums; fix significant muon // and track association-bugs; include Prereq module // and track association-bugs; include Prereq module // processName talk-to for object finding; // processName talk-to for object finding; // 59503: Fix bug in electron id word // 59503: Fix bug in electron id word // 59502: Fix stupid bug in muon met correction // 59502: Fix stupid bug in muon met correction // 59500: Add beam location info; add beam constrained trac // 59500: Add beam location info; add beam constrained trac // add secvtx tagging (unstable); add d0 corrected f // add secvtx tagging (unstable); add d0 corrected f // add corrections to met (unstable); add electron-p // add corrections to met (unstable); add electron-p // cross-reference; add electron conversion informat // cross-reference; add electron conversion informat // add BMU muons; add individual PJW corrections; ad // add BMU muons; add individual PJW corrections; ad // photon beam halo variables; add Matt's tau variab // photon beam halo variables; add Matt's tau variab // 59415: Add version information for production and offlin // 59415: Add version information for production and offlin // 59414: Fix bugs in photon cosmic stub count (duplicate s // 59414: Fix bugs in photon cosmic stub count (duplicate s // crashes in reverse tracking on pathologies // crashes in reverse tracking on pathologies // 59413: 7/26/02 Fix bugs at end of jet block // 59413: 7/26/02 Fix bugs at end of jet block // 59412: Ashutosh's reverse-tracking works! // 59412: Ashutosh's reverse-tracking works! // 59411: Made photon costub actually work; track extrapola // 59411: Made photon costub actually work; track extrapola // eta is done from plug if track would intersect th // eta is done from plug if track would intersect th // the CES radius; added number of towers used in PE // the CES radius; added number of towers used in PE // to electron block; added "5 over 9" poor-man's PE // to electron block; added "5 over 9" poor-man's PE // electron block; photon CES strip association made // electron block; photon CES strip association made // to centroid within 25 cm in z, and wire must be i // to centroid within 25 cm in z, and wire must be i // half-chamber as centroid when centroid is more th // half-chamber as centroid when centroid is more th // from break // from break // 59410: Fixed stupidity in tau block; added specific isol // 59410: Fixed stupidity in tau block; added specific isol // corrections for photons // corrections for photons // 59409: New tau code; electron PEM 3x3 chisq eta and phi // 59409: New tau code; electron PEM 3x3 chisq eta and phi // first attempt at integrating reverse-tracking cos // first attempt at integrating reverse-tracking cos // 59408: Met is now vertexed from vertex.vzev // 59408: Met is now vertexed from vertex.vzev // 59407: electron detector eta, four-vectors fixed // 59407: electron detector eta, four-vectors fixed // 59406: HEPG block added // 59406: HEPG block added // 59405: jet-to-vertex links made, anti-beam-halo variable // 59405: jet-to-vertex links made, anti-beam-halo variable // photons // photons // 59404: tau track links added // 59404: tau track links added // 59403: electron likelihood added // 59403: electron likelihood added // 59402: A whole bunch of (mostly plug) photon variables a // 59402: A whole bunch of (mostly plug) photon variables a // 59401: Include Anyes Taffard's cosmic ray detection (muo // 59401: Include Anyes Taffard's cosmic ray detection (muo // muon HADTDC timing; instantaneous luminosity; // muon HADTDC timing; instantaneous luminosity; // per-track tof information // per-track tof information // 59400: Change to CES cluster for computing electron dete // 59400: Change to CES cluster for computing electron dete // 59301: Turn on compression=2 for trigger block // 59301: Turn on compression=2 for trigger block // 59300: Overhaul trigger block, add tau and simulation co // 59300: Overhaul trigger block, add tau and simulation co // 59205: Get rid of fBits and fUniqueId in trigger branche // 59205: Get rid of fBits and fUniqueId in trigger branche // 59204: Fix a few error logger severities // 59204: Fix a few error logger severities // 59203: Fix bounds checking for jets, tracks, muons, elec // 59203: Fix bounds checking for jets, tracks, muons, elec // 59202: Fill jet corrections // 59202: Fill jet corrections // 59201: Fix photon block crashes when too many EMObjects // 59201: Fix photon block crashes when too many EMObjects // 59200: Bring back muon vertexing after incorporating pri // 59200: Bring back muon vertexing after incorporating pri // to 4.5.0 HLO muon code // to 4.5.0 HLO muon code private: private: myheader_t myheader; myheader_t myheader; myvertex_t myvertex; myvertex_t myvertex; myphoton_t myphoton; myphoton_t myphoton; mytrigger_t mytrigger; mytrigger_t mytrigger; mymet_t mymet; mymet_t mymet; myjet_t myjet; myjet_t myjet; myjet_t myjet2; myjet_t myjet2; myelectron_t myelectron; myelectron_t myelectron; mytrack_t mytrack; mytrack_t mytrack; mymuon_t mymuon; mymuon_t mymuon; mytau_t mytau; mytau_t mytau; mytagging_t mytagging; mytagging_t mytagging; myobsp_t myobsp; myobsp_t myobsp; myobsv_t myobsv; myobsv_t myobsv; myhepg_t myhepg; myhepg_t myhepg; mysvt_t mysvt; mysvt_t mysvt; myxtrp_t myxtrp; myxtrp_t myxtrp; myzbb_t myzbb; myzbb_t myzbb; mycaltrigger_t mycaltrigger; mycaltrigger_t mycaltrigger; mylevel3_t mylevel3; mylevel3_t mylevel3; TTree* tree; TTree* tree; // For trigger resolution // For trigger resolution Int_t currentrun; Int_t currentrun; TriggerMap* tmap; TriggerMap* tmap; RunSummary* runsum; RunSummary* runsum; // For track caching // For track caching CdfTrackView_h trackView_hndl; CdfTrackView_h trackView_hndl; // For jet caching // For jet caching JetList jetLists[2]; JetList jetLists[2]; // Cached for met block // Cached for met block PhysicsTowerDataMaker* ptdm; PhysicsTowerDataMaker* ptdm; // Cached for header block // Cached for header block CotBeam* cotbeam; CotBeam* cotbeam; SvxBeam* svxbeam; SvxBeam* svxbeam; // For level3 block // For level3 block L3BeamSpot _mBeamSpot; L3BeamSpot _mBeamSpot; Level3Filters::Cot2SvtMatch _mCot2SvtMatch; Level3Filters::Cot2SvtMatch _mCot2SvtMatch; // For Silicon Tracking // For Silicon Tracking bool _runStatus; bool _runStatus; SiExpected _siExpected; SiExpected _siExpected; // talk-to parameters // talk-to parameters AbsParmGeneral jetCollName; AbsParmGeneral jetCollName; AbsParmGeneral jetColl2Name; AbsParmGeneral jetColl2Name; AbsParmGeneral vertexCollType; AbsParmGeneral vertexCollType; AbsParmGeneral vertexCollName; AbsParmGeneral vertexCollName; AbsParmGeneral eventVertexStrategy; AbsParmGeneral eventVertexStrategy; AbsParmGeneral revertexMet; AbsParmGeneral revertexMet; AbsParmGeneral useRefitTracks; AbsParmGeneral useRefitTracks; AbsParmGeneral tracksRefitNow; AbsParmGeneral tracksRefitNow; AbsParmGeneral simulatedData; AbsParmGeneral simulatedData; AbsParmGeneral processName; AbsParmGeneral processName; APPMenu zbbMenu; APPMenu zbbMenu; AbsParmGeneral addZbbBlocks; AbsParmGeneral addZbbBlocks; AbsParmGeneral level3Info; AbsParmGeneral level3Info; AbsParmGeneral l3jet04CollName; AbsParmGeneral l3jet04CollName; AbsParmGeneral l3jet07CollName; AbsParmGeneral l3jet07CollName; AbsParmGeneral l3trkCollName; AbsParmGeneral l3trkCollName; AbsParmGeneral _mBeamStrategy; AbsParmGeneral _mBeamStrategy; | AbsParmGeneral _fpeCut; void ConstructHeaderBlock(void); void ConstructHeaderBlock(void); void ConstructVertexBlock(void); void ConstructVertexBlock(void); void ConstructTrackBlock(void); void ConstructTrackBlock(void); void ConstructPhotonBlock(void); void ConstructPhotonBlock(void); void ConstructTriggerBlock(void); void ConstructTriggerBlock(void); void ConstructMetBlock(void); void ConstructMetBlock(void); void ConstructJetBlock(void); void ConstructJetBlock(void); void ConstructJet2Block(void); void ConstructJet2Block(void); void ConstructElectronBlock(void); void ConstructElectronBlock(void); void ConstructMuonBlock(void); void ConstructMuonBlock(void); void ConstructTauBlock(void); void ConstructTauBlock(void); void ConstructTaggingBlock(void); void ConstructTaggingBlock(void); void ConstructObspBlock(void); void ConstructObspBlock(void); void ConstructObsvBlock(void); void ConstructObsvBlock(void); void ConstructHepgBlock(void); void ConstructHepgBlock(void); void ConstructSvtBlock(void); void ConstructSvtBlock(void); void ConstructXtrpBlock(void); void ConstructXtrpBlock(void); void ConstructZbbBlock(void); void ConstructZbbBlock(void); void ConstructCalTriggerBlock(void); void ConstructCalTriggerBlock(void); void ConstructLevel3Block(void); void ConstructLevel3Block(void); void ComputeHeaderBlock(AbsEvent* event); void ComputeHeaderBlock(AbsEvent* event); void ComputeVertexBlock(AbsEvent* event); void ComputeVertexBlock(AbsEvent* event); void ComputeTrackBlock(AbsEvent* event); void ComputeTrackBlock(AbsEvent* event); void ComputePhotonBlock(void); void ComputePhotonBlock(void); void ComputeTriggerBlock(AbsEvent* event); void ComputeTriggerBlock(AbsEvent* event); void ComputeMetBlock(AbsEvent* event); void ComputeMetBlock(AbsEvent* event); void ComputeJetBlock(AbsEvent* event); void ComputeJetBlock(AbsEvent* event); void ComputeElectronBlock(AbsEvent* event); void ComputeElectronBlock(AbsEvent* event); void ComputeMuonBlock(AbsEvent* event); void ComputeMuonBlock(AbsEvent* event); void ComputeTauBlock(void); void ComputeTauBlock(void); void ComputeTaggingBlock(AbsEvent* event); void ComputeTaggingBlock(AbsEvent* event); void ComputeObspBlock(AbsEvent* event); void ComputeObspBlock(AbsEvent* event); void ComputeObsvBlock(AbsEvent* event); void ComputeObsvBlock(AbsEvent* event); void ComputeHepgBlock(AbsEvent* event); void ComputeHepgBlock(AbsEvent* event); void ComputeSvtBlock(AbsEvent* event); void ComputeSvtBlock(AbsEvent* event); void ComputeXtrpBlock(AbsEvent* event); void ComputeXtrpBlock(AbsEvent* event); void ComputeZbbBlock(AbsEvent* event); void ComputeZbbBlock(AbsEvent* event); void ComputeCalTriggerBlock(AbsEvent* event); void ComputeCalTriggerBlock(AbsEvent* event); void ComputeLevel3Block(AbsEvent* event); void ComputeLevel3Block(AbsEvent* event); void ChooseEventVertex(); void ChooseEventVertex(); void ComputeJetBlockAfterVertex(AbsEvent* event); void ComputeJetBlockAfterVertex(AbsEvent* event); void MakeTrackToVertexLinks(void); void MakeTrackToVertexLinks(void); void MakeElectronToTrackLinks(void); void MakeElectronToTrackLinks(void); void MakeTrackToJetLinks(AbsEvent* event); void MakeTrackToJetLinks(AbsEvent* event); void CapturePhotonBlock(void); void CapturePhotonBlock(void); }; }; #endif #endif Index: FlatNtuple/src/EleBlock.cc =================================================================== RCS file: /cdf/code/cdfcvs/run2/FlatNtuple/src/EleBlock.cc,v retrieving revision 1.2 diff -b -y -r1.2 EleBlock.cc #include "UCNtuple/UCNtupleModule.hh" #include "UCNtuple/UCNtupleModule.hh" #include "UCNtuple/myelectron_t.hh" #include "UCNtuple/myelectron_t.hh" // headers used to fill electron block // headers used to fill electron block #include "ElectronObjects/CdfEmObjectView.hh" #include "ElectronObjects/CdfEmObjectView.hh" #include "ElectronObjects/EmCluster.hh" #include "ElectronObjects/EmCluster.hh" #include "HighLevelObjects/ElectronVariables.hh" #include "HighLevelObjects/ElectronVariables.hh" #include "HighLevelObjects/TrackingVariables.hh" #include "HighLevelObjects/TrackingVariables.hh" #include "HighLevelObjects/PhotonVariables.hh" // needed for #include "HighLevelObjects/PhotonVariables.hh" // needed for #include "Electron/PEMChiSquare.hh" #include "Electron/PEMChiSquare.hh" #include "inc/misc.hh" #include "inc/misc.hh" #include "SoftElectronAlgs/ConversionFinder.hh" #include "SoftElectronAlgs/ConversionFinder.hh" #include "SoftElectronObjects/ConversionColl.hh" #include "SoftElectronObjects/ConversionColl.hh" #include "Electron/emobj_alg.hh" #include "Electron/emobj_alg.hh" #include "TLeaf.h" #include "TLeaf.h" void UCNtupleModule::ConstructElectronBlock(void) { void UCNtupleModule::ConstructElectronBlock(void) { tree->Branch("ele",&myelectron, "nele/I:clustersize[nele]:\ tree->Branch("ele",&myelectron, "nele/I:clustersize[nele]:\ ntrks[nele]:detector[nele]:idword[nele]:isoword[nele]:conword ntrks[nele]:detector[nele]:idword[nele]:isoword[nele]:conword fidword[nele]:trkindex[nele]:\ fidword[nele]:trkindex[nele]:\ px[nele]/F:py[nele]:pz[nele]:e[nele]:et[nele]:etcorr[nele]:\ px[nele]/F:py[nele]:pz[nele]:e[nele]:et[nele]:etcorr[nele]:\ eveta[nele]:phi[nele]:\ eveta[nele]:phi[nele]:\ ettwotow[nele]:pttrk[nele]:deteta[nele]:ep[nele]:charge[nele] ettwotow[nele]:pttrk[nele]:deteta[nele]:ep[nele]:charge[nele] chi2strip[nele]:chi2three[nele]:chi2wire[nele]:eme[nele]:\ chi2strip[nele]:chi2three[nele]:chi2wire[nele]:eme[nele]:\ emet[nele]:emiso4[nele]:emiso7[nele]:hade[nele]:hadet[nele]:\ emet[nele]:emiso4[nele]:emiso7[nele]:hade[nele]:hadet[nele]:\ hadiso4[nele]:hadiso7[nele]:hadem[nele]:\ hadiso4[nele]:hadiso7[nele]:hadem[nele]:\ iso4[nele]:iso7[nele]:time[nele]:chatime[nele]:whatime[nele]: iso4[nele]:iso7[nele]:time[nele]:chatime[nele]:whatime[nele]: lshr[nele]:lshr2[nele]:\ lshr[nele]:lshr2[nele]:\ tiso[nele]:xces[nele]:delx[nele]:zces[nele]:delz[nele]:\ tiso[nele]:xces[nele]:delx[nele]:zces[nele]:delz[nele]:\ ztrk[nele]:ztrkces[nele]:zvtx[nele]:zcentroid[nele]:likelihoo ztrk[nele]:ztrkces[nele]:zvtx[nele]:zcentroid[nele]:likelihoo pchideteta[nele]:pchiphi[nele]:pchifittow[nele]:pes5by9U[nele pchideteta[nele]:pchiphi[nele]:pchifittow[nele]:pes5by9U[nele pes5by9V[nele]:convrad[nele]:phoindex[nele]/I:jetindex[nele]: pes5by9V[nele]:convrad[nele]:phoindex[nele]/I:jetindex[nele]: fidele[nele]"); fidele[nele]"); TBranch* eleBranch = tree->GetBranch("ele"); TBranch* eleBranch = tree->GetBranch("ele"); eleBranch->SetCompressionLevel(2); eleBranch->SetCompressionLevel(2); TObjArray* leaveslist = eleBranch->GetListOfLeaves(); TObjArray* leaveslist = eleBranch->GetListOfLeaves(); // For this fix, we skip nele and manually adjust the addre // For this fix, we skip nele and manually adjust the addre // of all following leaves. // of all following leaves. Int_t * pointer = myelectron.clustersize; Int_t * pointer = myelectron.clustersize; for (int i = 1; i < leaveslist->GetEntries(); i++) { for (int i = 1; i < leaveslist->GetEntries(); i++) { TLeaf * tl = (TLeaf*) (*leaveslist)[i]; TLeaf * tl = (TLeaf*) (*leaveslist)[i]; tl->SetAddress(pointer); tl->SetAddress(pointer); // tl->SetOffset((Int_t) ((void *) pointer) - ((void * // tl->SetOffset((Int_t) ((void *) pointer) - ((void * // cout << tl->GetValuePointer() << endl; // cout << tl->GetValuePointer() << endl; pointer += MAXELE; pointer += MAXELE; } } } } void UCNtupleModule::ComputeElectronBlock(AbsEvent* event) { void UCNtupleModule::ComputeElectronBlock(AbsEvent* event) { myelectron.nele = 0; myelectron.nele = 0; CdfEmObjectView_h emObjView_hndl; CdfEmObjectView_h emObjView_hndl; if (CdfEmObjectView::defEmObjects(emObjView_hndl, if (CdfEmObjectView::defEmObjects(emObjView_hndl, StorableObject::SelectByP StorableObject::SelectByP == CdfEmObjectColl::OK) { == CdfEmObjectColl::OK) { const CdfEmObjectView::collection_type emObjs = const CdfEmObjectView::collection_type emObjs = emObjView_hndl->contents(); emObjView_hndl->contents(); if (emObjs.size() > 0) { if (emObjs.size() > 0) { Int_t index = 0; Int_t index = 0; for (CdfEmObjectView::const_iterator emIter = emObjs.be for (CdfEmObjectView::const_iterator emIter = emObjs.be (emIter != emObjs.end()) && (index < MAXELE); ++em (emIter != emObjs.end()) && (index < MAXELE); ++em const CdfEmObject& emObject = **emIter; const CdfEmObject& emObject = **emIter; ++myelectron.nele; ++myelectron.nele; myelectron.clustersize[index] = emObject.matchingEmCl myelectron.clustersize[index] = emObject.matchingEmCl myelectron.ntrks[index] = emObject.numberTracks(); myelectron.ntrks[index] = emObject.numberTracks(); CdfEmObject::Track_link theTrack = emObject.maxPtTrac CdfEmObject::Track_link theTrack = emObject.maxPtTrac myelectron.detector[index] = ElectronVariables::eleDe myelectron.detector[index] = ElectronVariables::eleDe // Fill lots of words later // Fill lots of words later myelectron.idword[index] = -9; myelectron.idword[index] = -9; myelectron.isoword[index] = -9; myelectron.isoword[index] = -9; myelectron.conword[index] = -9; myelectron.conword[index] = -9; myelectron.fidword[index] = -9; myelectron.fidword[index] = -9; HepLorentzVector fourp = ElectronVariables::eleFourMo HepLorentzVector fourp = ElectronVariables::eleFourMo myelectron.px[index] = fourp.px(); myelectron.px[index] = fourp.px(); myelectron.py[index] = fourp.py(); myelectron.py[index] = fourp.py(); myelectron.pz[index] = fourp.pz(); myelectron.pz[index] = fourp.pz(); myelectron.e[index] = fourp.e(); myelectron.e[index] = fourp.e(); myelectron.et[index] = ElectronVariables::eleTotalEt( myelectron.et[index] = ElectronVariables::eleTotalEt( myelectron.etcorr[index] = ElectronVariables::eleCorr myelectron.etcorr[index] = ElectronVariables::eleCorr myelectron.eveta[index] = ElectronVariables::eleEtaEv myelectron.eveta[index] = ElectronVariables::eleEtaEv myelectron.phi[index] = ElectronVariables::elePhi(emO myelectron.phi[index] = ElectronVariables::elePhi(emO myelectron.ettwotow[index] = -99; myelectron.ettwotow[index] = -99; // myelectron.ettwotow[index] = ElectronVariables::eleTw // myelectron.ettwotow[index] = ElectronVariables::eleTw myelectron.pttrk[index] = ElectronVariables::eleTrack myelectron.pttrk[index] = ElectronVariables::eleTrack myelectron.deteta[index] = ElectronVariables::eleEtaD myelectron.deteta[index] = ElectronVariables::eleEtaD myelectron.ep[index] = ElectronVariables::eleEOverP(e myelectron.ep[index] = ElectronVariables::eleEOverP(e myelectron.charge[index] = ElectronVariables::eleChar myelectron.charge[index] = ElectronVariables::eleChar myelectron.chi2strip[index] = ElectronVariables::eleC myelectron.chi2strip[index] = ElectronVariables::eleC // ???? Limit to plug ???? // ???? Limit to plug ???? myelectron.chi2three[index] = emObject.matchingEmClus myelectron.chi2three[index] = emObject.matchingEmClus myelectron.chi2wire[index] = ElectronVariables::eleCh myelectron.chi2wire[index] = ElectronVariables::eleCh myelectron.chi2mean[index] = (myelectron.chi2strip[in myelectron.chi2mean[index] = (myelectron.chi2strip[in myelectron.eme[index] = ElectronVariables::eleRawEmEn myelectron.eme[index] = ElectronVariables::eleRawEmEn myelectron.emet[index] = ElectronVariables::eleEmEt(e myelectron.emet[index] = ElectronVariables::eleEmEt(e myelectron.emiso4[index] = ElectronVariables::eleEmIs myelectron.emiso4[index] = ElectronVariables::eleEmIs myelectron.emiso7[index] = ElectronVariables::eleEmIs myelectron.emiso7[index] = ElectronVariables::eleEmIs myelectron.hade[index] = ElectronVariables::eleRawHad myelectron.hade[index] = ElectronVariables::eleRawHad myelectron.hadet[index] = ElectronVariables::eleHadEt myelectron.hadet[index] = ElectronVariables::eleHadEt myelectron.hadiso4[index] = ElectronVariables::eleHad myelectron.hadiso4[index] = ElectronVariables::eleHad myelectron.hadiso7[index] = ElectronVariables::eleHad myelectron.hadiso7[index] = ElectronVariables::eleHad myelectron.hadem[index] = ElectronVariables::eleHadEm myelectron.hadem[index] = ElectronVariables::eleHadEm myelectron.iso4[index] = ElectronVariables::eleTotalI myelectron.iso4[index] = ElectronVariables::eleTotalI myelectron.iso7[index] = ElectronVariables::eleTotalI myelectron.iso7[index] = ElectronVariables::eleTotalI myelectron.time[index] = PhotonVariables::phoTime(emO myelectron.time[index] = PhotonVariables::phoTime(emO int dummy; int dummy; myelectron.chatime[index] = PhotonVariables::phoDetTi myelectron.chatime[index] = PhotonVariables::phoDetTi myelectron.whatime[index] = PhotonVariables::phoDetTi myelectron.whatime[index] = PhotonVariables::phoDetTi myelectron.phatime[index] = PhotonVariables::phoDetTi myelectron.phatime[index] = PhotonVariables::phoDetTi myelectron.lshr[index] = ElectronVariables::eleLshr(e myelectron.lshr[index] = ElectronVariables::eleLshr(e myelectron.lshr2[index] = ElectronVariables::eleLshr2 myelectron.lshr2[index] = ElectronVariables::eleLshr2 if(theTrack) { if(theTrack) { myelectron.tiso[index] = TrackingVariables::trkTrac myelectron.tiso[index] = TrackingVariables::trkTrac } } else { else { myelectron.tiso[index] = -9999.0; myelectron.tiso[index] = -9999.0; } } myelectron.xces[index] = ElectronVariables::eleXces(e myelectron.xces[index] = ElectronVariables::eleXces(e myelectron.delx[index] = ElectronVariables::eleDeltaX myelectron.delx[index] = ElectronVariables::eleDeltaX myelectron.zces[index] = ElectronVariables::eleZces(e myelectron.zces[index] = ElectronVariables::eleZces(e myelectron.delz[index] = ElectronVariables::eleDeltaZ myelectron.delz[index] = ElectronVariables::eleDeltaZ if(theTrack) { if(theTrack) { myelectron.ztrk[index] = TrackingVariables::trkZ0(& myelectron.ztrk[index] = TrackingVariables::trkZ0(& // Following Pasha: // Following Pasha: myelectron.ztrkces[index] = emObject.maxPtTrackLoca myelectron.ztrkces[index] = emObject.maxPtTrackLoca } } else { else { myelectron.ztrk[index] = -9999.0; myelectron.ztrk[index] = -9999.0; myelectron.ztrkces[index] = -9999.0; myelectron.ztrkces[index] = -9999.0; } } myelectron.zvtx[index] = ElectronVariables::eleZVerte myelectron.zvtx[index] = ElectronVariables::eleZVerte myelectron.zcentroid[index] = ElectronVariables::eleZ myelectron.zcentroid[index] = ElectronVariables::eleZ myelectron.pchideteta[index] = 0; myelectron.pchideteta[index] = 0; myelectron.pchiphi[index] = 0; myelectron.pchiphi[index] = 0; myelectron.pchifittow[index] = 0; myelectron.pchifittow[index] = 0; myelectron.pes5by9U[index] = -1; myelectron.pes5by9U[index] = -1; myelectron.pes5by9V[index] = -1; myelectron.pes5by9V[index] = -1; if (myelectron.detector[index] == 1) { if (myelectron.detector[index] == 1) { myelectron.pchideteta[index] = emObject.matchingEmC myelectron.pchideteta[index] = emObject.matchingEmC myelectron.pchiphi[index] = emObject.matchingEmClus myelectron.pchiphi[index] = emObject.matchingEmClus myelectron.pchifittow[index] = emObject.matchingEmC myelectron.pchifittow[index] = emObject.matchingEmC CdfEmObject::Pes_link pes = emObject.bestMatchingPe CdfEmObject::Pes_link pes = emObject.bestMatchingPe if (pes.is_nonnull()) { if (pes.is_nonnull()) { myelectron.pes5by9U[index] = pes->pesClusterU().p myelectron.pes5by9U[index] = pes->pesClusterU().p myelectron.pes5by9V[index] = pes->pesClusterV().p myelectron.pes5by9V[index] = pes->pesClusterV().p } else { } else { myelectron.pes5by9U[index] = 0; myelectron.pes5by9U[index] = 0; myelectron.pes5by9V[index] = 0; myelectron.pes5by9V[index] = 0; } } } } myelectron.trkindex[index] = -2; myelectron.trkindex[index] = -2; if (theTrack) { if (theTrack) { const CdfTrackView::collection_type tracks = trac const CdfTrackView::collection_type tracks = trac if (tracks.size() > 0) { if (tracks.size() > 0) { Int_t counter = 0; Int_t counter = 0; for (CdfTrackView::const_iterator trkIter = tra for (CdfTrackView::const_iterator trkIter = tra trkIter != tracks.end(); ++trkIter, counte trkIter != tracks.end(); ++trkIter, counte const CdfTrack& track = **trkIter; const CdfTrack& track = **trkIter; if (track.id() == theTrack->id() || if (track.id() == theTrack->id() || // begin 4.9.1 reprocessing workaround // begin 4.9.1 reprocessing workaround (TrackingVariables::trkBestFit(&*theTrac (TrackingVariables::trkBestFit(&*theTrac track.id())) { track.id())) { // Any better way? // Any better way? myelectron.trkindex[index] = counter; myelectron.trkindex[index] = counter; } } } } } } if (myelectron.trkindex[index] == -2) { if (myelectron.trkindex[index] == -2) { cout << "Electron track mismatch" << endl; | errlog.setSubroutine("ComputeEleBlock"); > ERRLOG(ELwarning, "No ele track") << "Cannot f > << endmsg; } } } else { } else { myelectron.trkindex[index] = -1; myelectron.trkindex[index] = -1; } } myelectron.likelihood[index] = ElectronVariables::ele myelectron.likelihood[index] = ElectronVariables::ele // Electron id word calculation (ewk baseline = 0x3d4 // Electron id word calculation (ewk baseline = 0x3d4 myelectron.idword[index] = 0; myelectron.idword[index] = 0; if (myelectron.detector[index] == 0) { if (myelectron.detector[index] == 0) { myelectron.idword[index] |= (myelectron.hadem[index myelectron.idword[index] |= (myelectron.hadem[index myelectron.idword[index] |= ((myelectron.ep[index] myelectron.idword[index] |= ((myelectron.ep[index] (myelectron.pttrk[inde (myelectron.pttrk[inde myelectron.idword[index] |= (myelectron.lshr[index] myelectron.idword[index] |= (myelectron.lshr[index] myelectron.idword[index] |= (fabs(myelectron.delx[i myelectron.idword[index] |= (fabs(myelectron.delx[i myelectron.idword[index] |= (fabs(myelectron.delx[i myelectron.idword[index] |= (fabs(myelectron.delx[i myelectron.idword[index] |= (fabs(myelectron.delz[i myelectron.idword[index] |= (fabs(myelectron.delz[i myelectron.idword[index] |= (fabs(myelectron.delz[i myelectron.idword[index] |= (fabs(myelectron.delz[i myelectron.idword[index] |= (myelectron.iso4[index] myelectron.idword[index] |= (myelectron.iso4[index] myelectron.idword[index] |= ((myelectron.iso4[index myelectron.idword[index] |= ((myelectron.iso4[index myphoton.lcor[myelect myphoton.lcor[myelect myelectron.idword[index] |= (myelectron.trkindex[in myelectron.idword[index] |= (myelectron.trkindex[in mytrack.naxialhits[mye mytrack.naxialhits[mye mytrack.nstereohits[my mytrack.nstereohits[my myelectron.idword[index] |= (myelectron.ztrk[index] myelectron.idword[index] |= (myelectron.ztrk[index] myelectron.idword[index] |= (myelectron.chi2strip[i myelectron.idword[index] |= (myelectron.chi2strip[i myelectron.chi2strip[i myelectron.chi2strip[i myelectron.idword[index] |= (-3.0 < myelectron.char myelectron.idword[index] |= (-3.0 < myelectron.char myelectron.charge[inde myelectron.charge[inde myelectron.idword[index] |= (myelectron.trkindex[in myelectron.idword[index] |= (myelectron.trkindex[in mytrack.naxialsl[myele mytrack.naxialsl[myele mytrack.nstereosl[myel mytrack.nstereosl[myel } else if (myelectron.detector[index] == 1) { } else if (myelectron.detector[index] == 1) { myelectron.idword[index] |= (myelectron.hadem[index myelectron.idword[index] |= (myelectron.hadem[index myelectron.idword[index] |= (myelectron.iso4[index] myelectron.idword[index] |= (myelectron.iso4[index] myelectron.idword[index] |= (myelectron.chi2three[i myelectron.idword[index] |= (myelectron.chi2three[i } } // electron fidword calculation // electron fidword calculation myelectron.fidword[index] = 0; myelectron.fidword[index] = 0; if (myelectron.detector[index] == 0) { if (myelectron.detector[index] == 0) { myelectron.fidword[index] |= (fabs(myelectron.xces[ myelectron.fidword[index] |= (fabs(myelectron.xces[ myelectron.fidword[index] |= (fabs(myelectron.zces[ myelectron.fidword[index] |= (fabs(myelectron.zces[ myelectron.fidword[index] |= (fabs(myelectron.zces[ myelectron.fidword[index] |= (fabs(myelectron.zces[ myelectron.fidword[index] |= (fabs(myelectron.zces[ myelectron.fidword[index] |= (fabs(myelectron.zces[ myelectron.fidword[index] |= (((myelectron.deteta[i myelectron.fidword[index] |= (((myelectron.deteta[i myelectron.deteta[i myelectron.deteta[i myelectron.phi[inde myelectron.phi[inde myelectron.phi[inde myelectron.phi[inde 0 : 1) << 4); 0 : 1) << 4); } else if (myelectron.detector[index] == 1) { } else if (myelectron.detector[index] == 1) { myelectron.fidword[index] |= (fabs(myelectron.pchid myelectron.fidword[index] |= (fabs(myelectron.pchid myelectron.fidword[index] |= (fabs(myelectron.pchid myelectron.fidword[index] |= (fabs(myelectron.pchid myelectron.fidword[index] |= (fabs(myelectron.pchid myelectron.fidword[index] |= (fabs(myelectron.pchid } } // the following bases fiduciality on shower max // the following bases fiduciality on shower max myelectron.fidele[index] = fidEle(emObject); myelectron.fidele[index] = fidEle(emObject); if (theTrack) { if (theTrack) { ConversionParam cp(this); ConversionParam cp(this); ConversionFinder cf; ConversionFinder cf; std::vector vec(8); std::vector vec(8); ConstHandle cc = cf.find_conversion ConstHandle cc = cf.find_conversion if (cc.is_nonnull()) { if (cc.is_nonnull()) { for (ConversionColl::const_iterator it = cc->cont for (ConversionColl::const_iterator it = cc->cont it != cc->contents().end(); it++) { it != cc->contents().end(); it++) { ConversionPartner cp = *it; ConversionPartner cp = *it; myelectron.conword[index] = 1; myelectron.conword[index] = 1; myelectron.convrad[index] = sqrt(cp.x_vertex()* myelectron.convrad[index] = sqrt(cp.x_vertex()* cp.y_vertex()* cp.y_vertex()* } } } else { } else { myelectron.conword[index] = -2; myelectron.conword[index] = -2; myelectron.convrad[index] = 0; myelectron.convrad[index] = 0; } } } else { } else { myelectron.conword[index] = -2; myelectron.conword[index] = -2; myelectron.convrad[index] = 0; myelectron.convrad[index] = 0; } } myelectron.phoindex[index] = index; myelectron.phoindex[index] = index; Int_t jetind = -1; Int_t jetind = -1; Float_t mindelr = 1e6; Float_t mindelr = 1e6; Float_t delphi, deleta, delr; Float_t delphi, deleta, delr; for (int j = 0; j < myjet.njet; j++) { for (int j = 0; j < myjet.njet; j++) { if (myjet.et[j] > 0) { if (myjet.et[j] > 0) { delphi = fabs(myjet.phi[j]-myelectron.phi[index]) delphi = fabs(myjet.phi[j]-myelectron.phi[index]) delphi = (delphi > PI) ? TWOPI - delphi : delphi; delphi = (delphi > PI) ? TWOPI - delphi : delphi; deleta = myjet.deteta[j]-myelectron.deteta[index] deleta = myjet.deteta[j]-myelectron.deteta[index] delr = sqrt(delphi*delphi + deleta*deleta); delr = sqrt(delphi*delphi + deleta*deleta); if (delr < mindelr) { if (delr < mindelr) { jetind = j; jetind = j; mindelr = delr; mindelr = delr; } } } } } } if (jetind >= 0 && mindelr < 0.7) { if (jetind >= 0 && mindelr < 0.7) { myelectron.jetindex[index] = jetind; myelectron.jetindex[index] = jetind; } else { } else { myelectron.jetindex[index] = -1; myelectron.jetindex[index] = -1; } } } } if (myelectron.nele == MAXELE) { if (myelectron.nele == MAXELE) { errlog.setSubroutine("ComputeElectronBlock"); errlog.setSubroutine("ComputeElectronBlock"); ERRLOG(ELsevere, "Too many EMObjects") << "More than" ERRLOG(ELsevere, "Too many EMObjects") << "More than" << " electron << " electron << endmsg; << endmsg; } } } } } } } } void UCNtupleModule::MakeElectronToTrackLinks(void) { void UCNtupleModule::MakeElectronToTrackLinks(void) { return; return; } } Index: FlatNtuple/src/SvtBlock.cc =================================================================== RCS file: /cdf/code/cdfcvs/run2/FlatNtuple/src/SvtBlock.cc,v retrieving revision 1.1.1.1 diff -b -y -r1.1.1.1 SvtBlock.cc #include #include #include #include #include #include #include "UCNtuple/UCNtupleModule.hh" #include "UCNtuple/UCNtupleModule.hh" #include "UCNtuple/mysvt_t.hh" #include "UCNtuple/mysvt_t.hh" // headers used to fill muon block // headers used to fill muon block #include "Edm/EventRecord.hh" #include "Edm/EventRecord.hh" #include "Edm/ConstHandle.hh" #include "Edm/ConstHandle.hh" #include "TLeaf.h" #include "TLeaf.h" #include "TriggerObjects/SVTD_StorableBank.hh" #include "TriggerObjects/SVTD_StorableBank.hh" #include "TriggerObjects/XFLD_StorableBank.hh" #include "TriggerObjects/XFLD_StorableBank.hh" #include "TriggerObjects/Trigger_StorableBank.hh" #include "TriggerObjects/Trigger_StorableBank.hh" #include "SVTMon/SVTDTrack.hh" #include "SVTMon/SVTDTrack.hh" #include "SVTMon/SVTDMonitor.hh" #include "SVTMon/SVTDMonitor.hh" #include "AbsEnv/AbsEnv.hh" #include "AbsEnv/AbsEnv.hh" #include "Zbb/SvtVariables.hh" #include "Zbb/SvtVariables.hh" using namespace SvtVariables; using namespace SvtVariables; void UCNtupleModule::ConstructSvtBlock(void) { void UCNtupleModule::ConstructSvtBlock(void) { TBranch* svtBranch = tree->Branch("svt",&mysvt, "nsvt/I:fid TBranch* svtBranch = tree->Branch("svt",&mysvt, "nsvt/I:fid // svtBranch->SetCompressionLevel(2); // svtBranch->SetCompressionLevel(2); TObjArray* leaveslist = svtBranch->GetListOfLeaves(); TObjArray* leaveslist = svtBranch->GetListOfLeaves(); // For this fix, we skip njet and manually adjust the addre // For this fix, we skip njet and manually adjust the addre // of all following leaves. // of all following leaves. Int_t * pointer = mysvt.fid; Int_t * pointer = mysvt.fid; for (int i = 1; i < leaveslist->GetEntries(); i++) { for (int i = 1; i < leaveslist->GetEntries(); i++) { TLeaf * tl = (TLeaf*) (*leaveslist)[i]; TLeaf * tl = (TLeaf*) (*leaveslist)[i]; tl->SetAddress(pointer); tl->SetAddress(pointer); if (tl->GetLeafCount()) { if (tl->GetLeafCount()) { pointer += MAXSVT; pointer += MAXSVT; } else { } else { pointer++; pointer++; } } } } } } void UCNtupleModule::ComputeSvtBlock(AbsEvent *event) { void UCNtupleModule::ComputeSvtBlock(AbsEvent *event) { mysvt.nsvt = 0; mysvt.nsvt = 0; for (EventRecord::ConstIterator iter(event, "SVTD_StorableB for (EventRecord::ConstIterator iter(event, "SVTD_StorableB ConstHandle svtd_h(iter); ConstHandle svtd_h(iter); mysvt.nsvt = svtd_h->get_number_of_tracks(); mysvt.nsvt = svtd_h->get_number_of_tracks(); Int_t ef0[50], ef1[50], ef2[50], ef3[50], ef4[50]; Int_t ef0[50], ef1[50], ef2[50], ef3[50], ef4[50]; for (int i=0; iget_word(1 + SVTD_SIZE*i + j)) data.push_back(svtd_h->get_word(1 + SVTD_SIZE*i + j)) SVTDTrack track(data); SVTDTrack track(data); mysvt.fid [i] = 0; //Not yet filled mysvt.fid [i] = 0; //Not yet filled mysvt.d0 [i] = d0(track); mysvt.d0 [i] = d0(track); mysvt.pt [i] = pt(track); mysvt.pt [i] = pt(track); mysvt.curv [i] = curv(track); mysvt.curv [i] = curv(track); mysvt.phi [i] = phi(track); mysvt.phi [i] = phi(track); mysvt.wedge [i] = wedge(track); mysvt.wedge [i] = wedge(track); mysvt.chi2 [i] = chi2(track); mysvt.chi2 [i] = chi2(track); ef0 [i] = hitEF0(track); ef0 [i] = hitEF0(track); ef1 [i] = hitEF1(track); ef1 [i] = hitEF1(track); ef2 [i] = hitEF2(track); ef2 [i] = hitEF2(track); ef3 [i] = hitEF3(track); ef3 [i] = hitEF3(track); ef4 [i] = hitEF4(track); ef4 [i] = hitEF4(track); mysvt.nhits[i] = ef0[i]+ef1[i]+ef2[i]+ef3[i]+ef4[i]; mysvt.nhits[i] = ef0[i]+ef1[i]+ef2[i]+ef3[i]+ef4[i]; mysvt.hitptrn[i] = (ef0[i] | (ef1[i]<<1) | (ef2[i]<<2 mysvt.hitptrn[i] = (ef0[i] | (ef1[i]<<1) | (ef2[i]<<2 if (mysvt.curv [i] >=0) mysvt.sign [i] = 1; if (mysvt.curv [i] >=0) mysvt.sign [i] = 1; else mysvt.sign [i] = -1; else mysvt.sign [i] = -1; for (EventRecord::ConstIterator xfld_iter(event,"XFLD for (EventRecord::ConstIterator xfld_iter(event,"XFLD int k=0; int k=0; Int_t xwedge[288]; Int_t xwedge[288]; ConstHandle xfld_h(xfld_iter); ConstHandle xfld_h(xfld_iter); if (xfld_h.is_nonnull()){ if (xfld_h.is_nonnull()){ if ( (xfld_h->bank_name()) != "XFLD"){ | if ( (xfld_h->bank_name()) != "XFLD") { cout << "XFLD bank NOT Found" << endl; | errlog.setSubroutine("ComputeSvtBlock"); > ERRLOG(ELwarning, "Misnomer") << "XFLD bank ha > << endmsg; } } else{ < < for(int crate=0;crate<3;crate++){ for(int crate=0;crate<3;crate++){ for(int board=0;board<8;board++){ for(int board=0;board<8;board++){ int lword[8]; int lword[8]; for (int lwd=0; lwd<4; lwd++){ for (int lwd=0; lwd<4; lwd++){ lword[lwd] = xfld_h->get_word(crate,board lword[lwd] = xfld_h->get_word(crate,board lword[lwd+4] = xfld_h->get_word(crate,boa lword[lwd+4] = xfld_h->get_word(crate,boa } } for(int ch=0;ch<12;ch++){ for(int ch=0;ch<12;ch++){ int ptbin = xfld_h->getPtBin(lword,ch); int ptbin = xfld_h->getPtBin(lword,ch); if (ptbin!=124){ if (ptbin!=124){ xwedge[k] = ((crate*8+board)*12+ch)-6*1 xwedge[k] = ((crate*8+board)*12+ch)-6*1 if (xwedge[k] < 0) xwedge[k] += 288; if (xwedge[k] < 0) xwedge[k] += 288; if (xwedge[k] == mysvt.wedge[i]) mysvt. if (xwedge[k] == mysvt.wedge[i]) mysvt. k++; k++; } } } } } } } } } < } } } } } } } } if (mysvt.nsvt == MAXSVT){ if (mysvt.nsvt == MAXSVT){ errlog.setSubroutine("ComputeSvtBlock"); errlog.setSubroutine("ComputeSvtBlock"); ERRLOG(ELsevere, "Too many Svt Tracks") << "More than" << ERRLOG(ELsevere, "Too many Svt Tracks") << "More than" << << " svt objects" << " svt objects" << endmsg; << endmsg; } } return; return; } } Index: FlatNtuple/src/UCNtupleModule.cc =================================================================== RCS file: /cdf/code/cdfcvs/run2/FlatNtuple/src/UCNtupleModule.cc,v retrieving revision 1.1.1.1 diff -b -y -r1.1.1.1 UCNtupleModule.cc //----------------------------------------------------------- //----------------------------------------------------------- // Edited: UC Ntuple module // Edited: UC Ntuple module //----------------------------------------------------------- //----------------------------------------------------------- #include "ISOcxx/ISOcxx.h" #include "ISOcxx/ISOcxx.h" //----------------------- //----------------------- // This Class's Header -- // This Class's Header -- //----------------------- //----------------------- #include "UCNtuple/UCNtupleModule.hh" #include "UCNtuple/UCNtupleModule.hh" //------------- //------------- // C Headers -- // C Headers -- //------------- //------------- #include #include //--------------- //--------------- // C++ Headers -- // C++ Headers -- //--------------- //--------------- //------------------------------- //------------------------------- // Collaborating Class Headers -- // Collaborating Class Headers -- //------------------------------- //------------------------------- #include "Edm/EventRecord.hh" #include "Edm/EventRecord.hh" #include "Edm/ConstHandle.hh" #include "Edm/ConstHandle.hh" #include "AbsEnv/AbsEnv.hh" #include "AbsEnv/AbsEnv.hh" #include "ErrorLogger_i/gERRLOG.hh" #include "ErrorLogger_i/gERRLOG.hh" #include "CalorObjects/CalData.hh" #include "CalorObjects/CalData.hh" #include "Calor/TowerPredicates.hh" #include "Calor/TowerPredicates.hh" #include "Calor/calorMakeView.hh" #include "Calor/calorMakeView.hh" #include "Calor/PhysicsTowerDataMaker.hh" #include "Calor/PhysicsTowerDataMaker.hh" #include "Alignment/CotBeam.hh" #include "Alignment/CotBeam.hh" #include "Alignment/SvxBeam.hh" #include "Alignment/SvxBeam.hh" #include "TObjArray.h" #include "TObjArray.h" #include "TObjString.h" #include "TObjString.h" //----------------------------------------------------------- //----------------------------------------------------------- // Local Macros, Typedefs, Structures, Unions and Forward Dec // Local Macros, Typedefs, Structures, Unions and Forward Dec //----------------------------------------------------------- //----------------------------------------------------------- static const char rcsid[] = "$Id: UCNtupleModule.cc,v 1.1.1.1 static const char rcsid[] = "$Id: UCNtupleModule.cc,v 1.1.1.1 //---------------- //---------------- // Constructors -- // Constructors -- //---------------- //---------------- UCNtupleModule::UCNtupleModule( UCNtupleModule::UCNtupleModule( const char* const theName, const char* const theName, const char* const theDescription ) const char* const theDescription ) : RootHistModule( theName, theDescription ), : RootHistModule( theName, theDescription ), currentrun(0), currentrun(0), processName("processName", this, "PROD"), processName("processName", this, "PROD"), jetCollName("jetCollName", this, "JetCluModule-cone0.4"), jetCollName("jetCollName", this, "JetCluModule-cone0.4"), jetColl2Name("jetColl2Name", this, "JetCluModule-cone0.7" jetColl2Name("jetColl2Name", this, "JetCluModule-cone0.7" vertexCollType("vertexCollType", this, "VertexColl"), vertexCollType("vertexCollType", this, "VertexColl"), vertexCollName("vertexCollName", this, "DEFAULT_VXPRIM_VE vertexCollName("vertexCollName", this, "DEFAULT_VXPRIM_VE eventVertexStrategy("eventVertexStrategy", this, 0, 0, 1) eventVertexStrategy("eventVertexStrategy", this, 0, 0, 1) revertexMet("revertexMet", this, true), revertexMet("revertexMet", this, true), useRefitTracks("useRefitTracks", this, true), useRefitTracks("useRefitTracks", this, true), tracksRefitNow("tracksRefitNow", this, true), tracksRefitNow("tracksRefitNow", this, true), simulatedData("simulatedData", this, false), simulatedData("simulatedData", this, false), addZbbBlocks("addZbbBlocks", this, false), addZbbBlocks("addZbbBlocks", this, false), level3Info("level3Info", this, false), level3Info("level3Info", this, false), l3jet04CollName("l3jet04CollName", this, "JetCluModule-co l3jet04CollName("l3jet04CollName", this, "JetCluModule-co l3jet07CollName("l3jet07CollName", this, "JetCluModule-co l3jet07CollName("l3jet07CollName", this, "JetCluModule-co l3trkCollName("l3trkCollName", this, "L3"), l3trkCollName("l3trkCollName", this, "L3"), _mBeamStrategy ("beamStrategy", this, L3BeamSpot::STAT _mBeamStrategy ("beamStrategy", this, L3BeamSpot::STAT _mCot2SvtMatch (this) | _mCot2SvtMatch (this), > _fpeCut("fpeCut", this, 0.) { { processName.addDescription("\tChoose which process name to processName.addDescription("\tChoose which process name to commands()->append(&processName); commands()->append(&processName); jetCollName.addDescription("\tChoose which jet collection t jetCollName.addDescription("\tChoose which jet collection t commands()->append(&jetCollName); commands()->append(&jetCollName); jetColl2Name.addDescription("\tChoose which jet collection jetColl2Name.addDescription("\tChoose which jet collection commands()->append(&jetColl2Name); commands()->append(&jetColl2Name); vertexCollType.addDescription("\tChoose which type of verte vertexCollType.addDescription("\tChoose which type of verte \tValid options are VertexColl and ZVertexColl"); \tValid options are VertexColl and ZVertexColl"); commands()->append(&vertexCollType); commands()->append(&vertexCollType); vertexCollName.addDescription("\tChoose which vertex collec vertexCollName.addDescription("\tChoose which vertex collec commands()->append(&vertexCollName); commands()->append(&vertexCollName); eventVertexStrategy.addDescription( eventVertexStrategy.addDescription( "\tChoose what strategy is used for finding the event vertex\ "\tChoose what strategy is used for finding the event vertex\ \t(vertex.vzev).\n\ \t(vertex.vzev).\n\ \t\t0 = highest sum-pt vertex, else zero;\n\ \t\t0 = highest sum-pt vertex, else zero;\n\ \t\t1 = vertex closest to z0 of highest pt good lepton."); \t\t1 = vertex closest to z0 of highest pt good lepton."); commands()->append(&eventVertexStrategy); commands()->append(&eventVertexStrategy); revertexMet.addDescription("\tRecompute missing Et with eve revertexMet.addDescription("\tRecompute missing Et with eve commands()->append(&revertexMet); commands()->append(&revertexMet); useRefitTracks.addDescription("\tUse tracks that have been useRefitTracks.addDescription("\tUse tracks that have been commands()->append(&useRefitTracks); commands()->append(&useRefitTracks); tracksRefitNow.addDescription( tracksRefitNow.addDescription( "\tSet to true if TrackRefitModule is being run in this execu "\tSet to true if TrackRefitModule is being run in this execu \tto false if refit tracks are already present in the data be \tto false if refit tracks are already present in the data be commands()->append(&tracksRefitNow); commands()->append(&tracksRefitNow); simulatedData.addDescription("\tSet this to true to include simulatedData.addDescription("\tSet this to true to include commands()->append(&simulatedData); commands()->append(&simulatedData); addZbbBlocks.addDescription("\tSet this to true to include addZbbBlocks.addDescription("\tSet this to true to include commands()->append(&addZbbBlocks); commands()->append(&addZbbBlocks); zbbMenu.initialize("zbbMenu", this); zbbMenu.initialize("zbbMenu", this); zbbMenu.initTitle("Z->b bbar options"); zbbMenu.initTitle("Z->b bbar options"); commands()->append(&zbbMenu); commands()->append(&zbbMenu); level3Info.addDescription("\tSet this to true to include Le level3Info.addDescription("\tSet this to true to include Le zbbMenu.commands()->append(&level3Info); zbbMenu.commands()->append(&level3Info); l3jet04CollName.addDescription( l3jet04CollName.addDescription( "\tChoose name of the jet collection to use in making level3 "\tChoose name of the jet collection to use in making level3 \t(JetCluModule-cone0.4 to use default) and process name \n\ \t(JetCluModule-cone0.4 to use default) and process name \n\ \tspecificator (L3 is a default) separated by semicolon, like \tspecificator (L3 is a default) separated by semicolon, like \t:."); \t:."); zbbMenu.commands()->append(&l3jet04CollName); zbbMenu.commands()->append(&l3jet04CollName); l3jet07CollName.addDescription( l3jet07CollName.addDescription( "\tChoose name of the jet collection to use in making level3 "\tChoose name of the jet collection to use in making level3 \t(JetCluModule-cone0.7 to use default) and process name \n\ \t(JetCluModule-cone0.7 to use default) and process name \n\ \tspecificator (L3 is a default) separated by semicolon, like \tspecificator (L3 is a default) separated by semicolon, like \t:."); \t:."); zbbMenu.commands()->append(&l3jet07CollName); zbbMenu.commands()->append(&l3jet07CollName); l3trkCollName.addDescription ( l3trkCollName.addDescription ( "\tname of the track view to match with the svt tracks (defTr "\tname of the track view to match with the svt tracks (defTr \t use default) and process name specificator (curent process \t use default) and process name specificator (curent process \tdefault) separated by semicolomn, like ::append(&l3trkCollName); zbbMenu.commands()->append(&l3trkCollName); _mBeamStrategy.addDescription( _mBeamStrategy.addDescription( "\tbeam spot strategy: %sprovide Beam Spot position for the c "\tbeam spot strategy: %sprovide Beam Spot position for the c \tdata. Supported algorithms are: 0 - %s, 1 - %s, 2 - %s, 3 - \tdata. Supported algorithms are: 0 - %s, 1 - %s, 2 - %s, 3 - \t(not implemented)"); \t(not implemented)"); zbbMenu.commands()->append(& _mBeamStrategy); zbbMenu.commands()->append(& _mBeamStrategy); // _mCot2SvtMatch.addDescription("\tCuts to match svt to c // _mCot2SvtMatch.addDescription("\tCuts to match svt to c zbbMenu.commands()->append(& _mCot2SvtMatch); zbbMenu.commands()->append(& _mCot2SvtMatch); | zbbMenu.commands()->append(& _fpeCut); > _fpeCut.addDescription("Cut to skip HEPG objects with small cout << "UCNtupleModule: version is " << NTVERSION << endl; cout << "UCNtupleModule: version is " << NTVERSION << endl; fgMakeSubdirs = 0; fgMakeSubdirs = 0; } } //-------------- //-------------- // Destructor -- // Destructor -- //-------------- //-------------- UCNtupleModule::~UCNtupleModule( ) UCNtupleModule::~UCNtupleModule( ) { { } } //-------------- //-------------- // Operations -- // Operations -- //-------------- //-------------- AppResult UCNtupleModule::beginJob( AbsEvent* aJob ) AppResult UCNtupleModule::beginJob( AbsEvent* aJob ) { { beforeBeginJob(aJob); beforeBeginJob(aJob); tree = new TTree("ucntuple", "UC Ntuple 6"); tree = new TTree("ucntuple", "UC Ntuple 6"); ConstructHeaderBlock(); ConstructHeaderBlock(); ConstructVertexBlock(); ConstructVertexBlock(); ConstructPhotonBlock(); ConstructPhotonBlock(); ConstructMetBlock(); ConstructMetBlock(); ConstructTriggerBlock(); ConstructTriggerBlock(); ConstructJetBlock(); ConstructJetBlock(); ConstructJet2Block(); ConstructJet2Block(); ConstructElectronBlock(); ConstructElectronBlock(); ConstructTrackBlock(); ConstructTrackBlock(); ConstructMuonBlock(); ConstructMuonBlock(); ConstructTauBlock(); ConstructTauBlock(); ConstructTaggingBlock(); ConstructTaggingBlock(); if (simulatedData.value()) { if (simulatedData.value()) { ConstructHepgBlock(); ConstructHepgBlock(); ConstructObspBlock(); ConstructObspBlock(); ConstructObsvBlock(); ConstructObsvBlock(); } } if (addZbbBlocks.value()) { if (addZbbBlocks.value()) { if (simulatedData.value()) { if (simulatedData.value()) { ConstructZbbBlock(); ConstructZbbBlock(); } } ConstructSvtBlock(); ConstructSvtBlock(); ConstructXtrpBlock(); ConstructXtrpBlock(); ConstructCalTriggerBlock(); ConstructCalTriggerBlock(); if (level3Info.value()) { if (level3Info.value()) { ConstructLevel3Block(); ConstructLevel3Block(); } } } } HistogramList()->Add(tree); HistogramList()->Add(tree); tree->Print(); tree->Print(); cout << "Tree will be stored in file " << fgFileName << end cout << "Tree will be stored in file " << fgFileName << end ptdm = new PhysicsTowerDataMaker(); ptdm = new PhysicsTowerDataMaker(); cotbeam = new CotBeam("default"); cotbeam = new CotBeam("default"); svxbeam = new SvxBeam("default"); svxbeam = new SvxBeam("default"); afterBeginJob(aJob); afterBeginJob(aJob); return AppResult::OK; return AppResult::OK; } } AppResult UCNtupleModule::beginRun( AbsEvent* aRun) { AppResult UCNtupleModule::beginRun( AbsEvent* aRun) { if (level3Info.value()) { if (level3Info.value()) { _mBeamSpot.setAlgorithm ((L3BeamSpot::Algorithm) _mBeamSt _mBeamSpot.setAlgorithm ((L3BeamSpot::Algorithm) _mBeamSt _mBeamSpot.beginRun (aRun); _mBeamSpot.beginRun (aRun); } } _runStatus = _siExpected.beginRun(); _runStatus = _siExpected.beginRun(); return AppResult::OK; return AppResult::OK; } } AppResult UCNtupleModule::event( AbsEvent* anEvent ) AppResult UCNtupleModule::event( AbsEvent* anEvent ) { { // beforeEvent(anEvent); // beforeEvent(anEvent); ComputeHeaderBlock(anEvent); ComputeHeaderBlock(anEvent); if (verbose()) { if (verbose()) { printf("Event: %d\n", myheader.event); printf("Event: %d\n", myheader.event); } } ComputeTriggerBlock(anEvent); ComputeTriggerBlock(anEvent); ComputeVertexBlock(anEvent); ComputeVertexBlock(anEvent); ComputeTrackBlock(anEvent); // Side effect: fixes up trackV ComputeTrackBlock(anEvent); // Side effect: fixes up trackV ComputeJetBlock(anEvent); ComputeJetBlock(anEvent); ComputeElectronBlock(anEvent); ComputeElectronBlock(anEvent); ComputeMuonBlock(anEvent); ComputeMuonBlock(anEvent); ChooseEventVertex(); ChooseEventVertex(); ComputePhotonBlock(); ComputePhotonBlock(); ComputeTauBlock(); ComputeTauBlock(); ComputeTaggingBlock(anEvent); ComputeTaggingBlock(anEvent); ComputeMetBlock(anEvent); ComputeMetBlock(anEvent); if (simulatedData.value()) { if (simulatedData.value()) { ComputeHepgBlock(anEvent); ComputeHepgBlock(anEvent); ComputeObspBlock(anEvent); ComputeObspBlock(anEvent); ComputeObsvBlock(anEvent); ComputeObsvBlock(anEvent); } } if (addZbbBlocks.value()) { if (addZbbBlocks.value()) { if (simulatedData.value()) { if (simulatedData.value()) { ComputeZbbBlock(anEvent); ComputeZbbBlock(anEvent); } } ComputeSvtBlock(anEvent); ComputeSvtBlock(anEvent); ComputeXtrpBlock(anEvent); ComputeXtrpBlock(anEvent); ComputeCalTriggerBlock(anEvent); ComputeCalTriggerBlock(anEvent); if (level3Info.value()) { if (level3Info.value()) { ComputeLevel3Block(anEvent); ComputeLevel3Block(anEvent); } } } } ComputeJetBlockAfterVertex(anEvent); ComputeJetBlockAfterVertex(anEvent); MakeTrackToVertexLinks(); MakeTrackToVertexLinks(); MakeElectronToTrackLinks(); MakeElectronToTrackLinks(); MakeTrackToJetLinks(anEvent); MakeTrackToJetLinks(anEvent); CapturePhotonBlock(); CapturePhotonBlock(); currentrun = myheader.run; currentrun = myheader.run; tree->Fill(); tree->Fill(); return AppResult::OK; return AppResult::OK; } } AppResult UCNtupleModule::endJob(AbsEvent* aJob) { AppResult UCNtupleModule::endJob(AbsEvent* aJob) { afterEndJob(aJob); afterEndJob(aJob); return AppResult::OK; return AppResult::OK; } } AppModule* UCNtupleModule::clone(const char* cloneName) { AppModule* UCNtupleModule::clone(const char* cloneName) { return new UCNtupleModule(cloneName,"this module is a clone return new UCNtupleModule(cloneName,"this module is a clone } } const char * UCNtupleModule::rcsId( ) const { const char * UCNtupleModule::rcsId( ) const { return rcsid; return rcsid; } } Index: FlatNtuple/src/XtrpBlock.cc =================================================================== RCS file: /cdf/code/cdfcvs/run2/FlatNtuple/src/XtrpBlock.cc,v retrieving revision 1.1.1.1 diff -b -y -r1.1.1.1 XtrpBlock.cc #include #include #include #include #include #include #include "UCNtuple/UCNtupleModule.hh" #include "UCNtuple/UCNtupleModule.hh" #include "UCNtuple/myxtrp_t.hh" #include "UCNtuple/myxtrp_t.hh" // headers used to fill muon block // headers used to fill muon block #include "Edm/EventRecord.hh" #include "Edm/EventRecord.hh" #include "Edm/ConstHandle.hh" #include "Edm/ConstHandle.hh" #include "TLeaf.h" #include "TLeaf.h" #include "TriggerObjects/XFLD_StorableBank.hh" #include "TriggerObjects/XFLD_StorableBank.hh" #include "TriggerObjects/Trigger_StorableBank.hh" #include "TriggerObjects/Trigger_StorableBank.hh" #include "SVTMon/SVTDTrack.hh" #include "SVTMon/SVTDTrack.hh" #include "SVTMon/SVTDMonitor.hh" #include "SVTMon/SVTDMonitor.hh" #include "AbsEnv/AbsEnv.hh" #include "AbsEnv/AbsEnv.hh" #include "Zbb/XtrpVariables.hh" #include "Zbb/XtrpVariables.hh" #undef MAXXTRP #undef MAXXTRP using namespace XtrpVariables; using namespace XtrpVariables; void UCNtupleModule::ConstructXtrpBlock(void) { void UCNtupleModule::ConstructXtrpBlock(void) { TBranch* xtrpBranch = tree->Branch("xtrp",&myxtrp, "nxtrp/I TBranch* xtrpBranch = tree->Branch("xtrp",&myxtrp, "nxtrp/I // xtrpBranch->SetCompressionLevel(2); // xtrpBranch->SetCompressionLevel(2); TObjArray* leaveslist = xtrpBranch->GetListOfLeaves(); TObjArray* leaveslist = xtrpBranch->GetListOfLeaves(); // For this fix, we skip njet and manually adjust the addre // For this fix, we skip njet and manually adjust the addre // of all following leaves. // of all following leaves. Int_t * pointer = myxtrp.fid; Int_t * pointer = myxtrp.fid; for (int i = 1; i < leaveslist->GetEntries(); i++) { for (int i = 1; i < leaveslist->GetEntries(); i++) { TLeaf * tl = (TLeaf*) (*leaveslist)[i]; TLeaf * tl = (TLeaf*) (*leaveslist)[i]; tl->SetAddress(pointer); tl->SetAddress(pointer); if (tl->GetLeafCount()) { if (tl->GetLeafCount()) { pointer += MAXXTRP; pointer += MAXXTRP; } else { } else { pointer++; pointer++; } } } } cout << "TBranch thinks nhits is at " << xtrpBranch->GetLea cout << "TBranch thinks nhits is at " << xtrpBranch->GetLea cout << "myxtrp thinks nhits is at " << myxtrp.nhits << end cout << "myxtrp thinks nhits is at " << myxtrp.nhits << end cout << "Construction thinks MAXXTRP is " << MAXXTRP << end cout << "Construction thinks MAXXTRP is " << MAXXTRP << end } } void UCNtupleModule::ComputeXtrpBlock(AbsEvent *event) { void UCNtupleModule::ComputeXtrpBlock(AbsEvent *event) { myxtrp.nxtrp = 0; myxtrp.nxtrp = 0; for (EventRecord::ConstIterator xfld_iter(event,"XFLD_Stora for (EventRecord::ConstIterator xfld_iter(event,"XFLD_Stora int k=0; int k=0; ConstHandle xfld_h(xfld_iter); ConstHandle xfld_h(xfld_iter); if (xfld_h.is_nonnull()){ if (xfld_h.is_nonnull()){ if ( (xfld_h->bank_name()) != "XFLD"){ | if ((xfld_h->bank_name()) != "XFLD") { cout << "XFLD bank NOT Found" << endl; | errlog.setSubroutine("ComputeXtrpBlock"); > ERRLOG(ELwarning, "Misnomer") << "XFLD bank has bad > << endmsg; } } < else{ < < for(int crate=0;crate<3;crate++){ for(int crate=0;crate<3;crate++){ for(int board=0;board<8;board++){ for(int board=0;board<8;board++){ int lword[8]; int lword[8]; for (int lwd=0; lwd<4; lwd++){ for (int lwd=0; lwd<4; lwd++){ lword[lwd] = xfld_h->get_word(crate,board,lwd+4 lword[lwd] = xfld_h->get_word(crate,board,lwd+4 lword[lwd+4] = xfld_h->get_word(crate,board,lwd lword[lwd+4] = xfld_h->get_word(crate,board,lwd } } for(int ch=0;ch<12;ch++){ for(int ch=0;ch<12;ch++){ int ptbin = xfld_h->getPtBin(lword,ch); int ptbin = xfld_h->getPtBin(lword,ch); if (ptbin!=124){ if (ptbin!=124){ myxtrp.fid [k] = 0; //Not yet filled myxtrp.fid [k] = 0; //Not yet filled int shrt = xfld_h->getShortTrk(lword,ch); int shrt = xfld_h->getShortTrk(lword,ch); // int iso = xfld_h->getIsol(lw // int iso = xfld_h->getIsol(lw if (shrt) myxtrp.nhits[k] = 3; if (shrt) myxtrp.nhits[k] = 3; else myxtrp.nhits[k] = 4; else myxtrp.nhits[k] = 4; myxtrp.wedge[k] = wedge(crate,board,ch); myxtrp.wedge[k] = wedge(crate,board,ch); if (myxtrp.wedge[k]<0) myxtrp.wedge[k] +=288; if (myxtrp.wedge[k]<0) myxtrp.wedge[k] +=288; int phibin = ((crate*8+board)*12+ch)*8 + xfl int phibin = ((crate*8+board)*12+ch)*8 + xfl if (phibin<0) phibin +=288*8; if (phibin<0) phibin +=288*8; myxtrp.pt[k] = pt(ptbin,shrt); myxtrp.pt[k] = pt(ptbin,shrt); myxtrp.sign[k] = sign(ptbin,shrt); myxtrp.sign[k] = sign(ptbin,shrt); // printf("%f\n",myxtrp.pt[k]); // printf("%f\n",myxtrp.pt[k]); myxtrp.curv[k] = curv(myxtrp.sign[k],myxtrp.p myxtrp.curv[k] = curv(myxtrp.sign[k],myxtrp.p myxtrp.phi[k] = phi(phibin,myxtrp.curv[k],myx myxtrp.phi[k] = phi(phibin,myxtrp.curv[k],myx k++; k++; } } } } } } } } } < } } myxtrp.nxtrp = k; myxtrp.nxtrp = k; } } if (myxtrp.nxtrp == MAXXTRP){ if (myxtrp.nxtrp == MAXXTRP){ errlog.setSubroutine("ComputeXtrpBlock"); errlog.setSubroutine("ComputeXtrpBlock"); ERRLOG(ELsevere, "Too many Xtrp Tracks") << "More than" < ERRLOG(ELsevere, "Too many Xtrp Tracks") << "More than" < << " xtrp objects" << " xtrp objects" << endmsg; << endmsg; } } return; return; } } Index: FlatNtuple/src/ZbbBlock.cc =================================================================== RCS file: /cdf/code/cdfcvs/run2/FlatNtuple/src/ZbbBlock.cc,v retrieving revision 1.2 diff -b -y -r1.2 ZbbBlock.cc #include "UCNtuple/UCNtupleModule.hh" #include "UCNtuple/UCNtupleModule.hh" #include "UCNtuple/myzbb_t.hh" #include "UCNtuple/myzbb_t.hh" // headers used to fill zbb block // headers used to fill zbb block #include "HighLevelObjects/HepgVariables.hh" #include "HighLevelObjects/HepgVariables.hh" #include "SimulationObjects/HEPG_StorableBank.hh" #include "SimulationObjects/HEPG_StorableBank.hh" #include "TLeaf.h" #include "TLeaf.h" using namespace HepgVariables; using namespace HepgVariables; void UCNtupleModule::ConstructZbbBlock(void) { void UCNtupleModule::ConstructZbbBlock(void) { tree->Branch("zbb",&myzbb, "hepgZ/I:ptZ/F:etaZ:phiZ:hepgPar tree->Branch("zbb",&myzbb, "hepgZ/I:ptZ/F:etaZ:phiZ:hepgPar jetParton[2]:ptParton[2]/F:etaParton[2]:phiParton[2]:dijetmas jetParton[2]:ptParton[2]/F:etaParton[2]:phiParton[2]:dijetmas ngele/I:hepgElectron[ngele]:obspElectron[ngele]:jetElectron[n ngele/I:hepgElectron[ngele]:obspElectron[ngele]:jetElectron[n ptElectron[ngele]/F:etaElectron[ngele]:phiElectron[ngele]:\ ptElectron[ngele]/F:etaElectron[ngele]:phiElectron[ngele]:\ ngmuo/I:hepgMuon[ngmuo]:obspMuon[ngmuo]:jetMuon[ngmuo]:\ ngmuo/I:hepgMuon[ngmuo]:obspMuon[ngmuo]:jetMuon[ngmuo]:\ ptMuon[ngmuo]/F:etaMuon[ngmuo]:phiMuon[ngmuo]:\ ptMuon[ngmuo]/F:etaMuon[ngmuo]:phiMuon[ngmuo]:\ ngneu/I:hepgNeutrino[ngneu]:obspNeutrino[ngneu]:jetNeutrino[n ngneu/I:hepgNeutrino[ngneu]:obspNeutrino[ngneu]:jetNeutrino[n ptNeutrino[ngneu]/F:etaNeutrino[ngneu]:phiNeutrino[ngneu]"); ptNeutrino[ngneu]/F:etaNeutrino[ngneu]:phiNeutrino[ngneu]"); TBranch* zbbBranch = tree->GetBranch("zbb"); TBranch* zbbBranch = tree->GetBranch("zbb"); zbbBranch->SetCompressionLevel(2); zbbBranch->SetCompressionLevel(2); TObjArray* leaveslist = zbbBranch->GetListOfLeaves(); TObjArray* leaveslist = zbbBranch->GetListOfLeaves(); // For this fix, we skip hepgZ and manually adjust the addr // For this fix, we skip hepgZ and manually adjust the addr // of all following leaves. // of all following leaves. Int_t * pointer = &myzbb.hepgZ; Int_t * pointer = &myzbb.hepgZ; for (int i = 0; i < leaveslist->GetEntries(); i++) { for (int i = 0; i < leaveslist->GetEntries(); i++) { TLeaf * tl = (TLeaf*) (*leaveslist)[i]; TLeaf * tl = (TLeaf*) (*leaveslist)[i]; tl->SetAddress(pointer); tl->SetAddress(pointer); if (strstr(tl->GetTitle(), "[2]")) { if (strstr(tl->GetTitle(), "[2]")) { pointer += 2; pointer += 2; } else if (strstr(tl->GetTitle(), "[ngele]")) { } else if (strstr(tl->GetTitle(), "[ngele]")) { pointer += MAXGELE; pointer += MAXGELE; } else if (strstr(tl->GetTitle(), "[ngmuo]")) { } else if (strstr(tl->GetTitle(), "[ngmuo]")) { pointer += MAXGMUO; pointer += MAXGMUO; } else if (strstr(tl->GetTitle(), "[ngneu]")) { } else if (strstr(tl->GetTitle(), "[ngneu]")) { pointer += MAXGNEU; pointer += MAXGNEU; } else { } else { pointer++; pointer++; } } } } } } void UCNtupleModule::ComputeZbbBlock(AbsEvent* event) { | float getEtaFromHEPG(float pz_pt) { > float temp = sqrt((pz_pt*pz_pt) + 1.0) - pz_pt; > if (temp != 0. ) return (- log(temp)); > return 0; > } > void UCNtupleModule::ComputeZbbBlock(AbsEvent* event) { > float ZERO = _fpeCut.value(); // Reset Variables // Reset Variables myzbb.hepgZ = -999; myzbb.hepgZ = -999; myzbb.ptZ = -999.; myzbb.ptZ = -999.; myzbb.etaZ = -999.; myzbb.etaZ = -999.; myzbb.phiZ = -999.; myzbb.phiZ = -999.; myzbb.dijetmass = -999.; myzbb.dijetmass = -999.; for (int nparton = 0; nparton<2; nparton++) { for (int nparton = 0; nparton<2; nparton++) { myzbb.ptParton[nparton] = -999.; myzbb.ptParton[nparton] = -999.; myzbb.etaParton[nparton] = -999.; myzbb.etaParton[nparton] = -999.; myzbb.phiParton[nparton] = -999.; myzbb.phiParton[nparton] = -999.; myzbb.jetParton[nparton] = -999; myzbb.jetParton[nparton] = -999; myzbb.hepgParton[nparton] = -999; myzbb.hepgParton[nparton] = -999; } } myzbb.ngele = 0; myzbb.ngele = 0; myzbb.ngmuo = 0; myzbb.ngmuo = 0; myzbb.ngneu = 0; myzbb.ngneu = 0; for (int electron = 0; electronZERO) { eta_par = hepg.Pz(partIter)/pt_par; | eta_par = getEtaFromHEPG(hepg.Pz(partIter)/pt_par); eta_par = -log( - eta_par + sqrt(eta_par*eta_par+1. < phi_par = atan2(hepg.Py(partIter),hepg.Px(partIter) phi_par = atan2(hepg.Py(partIter),hepg.Px(partIter) if (phi_par<0.) phi_par += 2.*3.1416; if (phi_par<0.) phi_par += 2.*3.1416; } else { } else { eta_par = 999.*hepg.Pz(partIter)/fabs(hepg.Pz(partI eta_par = 999.*hepg.Pz(partIter)/fabs(hepg.Pz(partI phi_par = 999.; phi_par = 999.; } } myzbb.ptZ = pt_par; myzbb.ptZ = pt_par; myzbb.etaZ = eta_par; myzbb.etaZ = eta_par; myzbb.phiZ = phi_par; myzbb.phiZ = phi_par; } } // look for first daus. ... // look for first daus. ... int i0mo1 = hepg.jmo1hep(partIter) - 1; int i0mo1 = hepg.jmo1hep(partIter) - 1; if (i0mo1==i0lastZ) { if (i0mo1==i0lastZ) { float pt_par = sqrt( hepg.Px(partIter)*hepg.Px(partI float pt_par = sqrt( hepg.Px(partIter)*hepg.Px(part hepg.Py(partIter)*hepg.Py(partI hepg.Py(partIter)*hepg.Py(partI float eta_par = hepg.Pz(partIter)/pt_par; | float eta_par = (pt_par>ZERO) ? getEtaFromHEPG(hepg. eta_par = -log( - eta_par + sqrt(eta_par*eta_par+1.) | float phi_par = (pt_par>ZERO) ? atan2(hepg.Py(partIt float phi_par = atan2(hepg.Py(partIter),hepg.Px(partI < if (phi_par<0.) phi_par += 2.*3.1416; if (phi_par<0.) phi_par += 2.*3.1416; int npar = 0; int npar = 0; if (idpart<0) npar = 1; if (idpart<0) npar = 1; myzbb.hepgParton[npar] = i0part; myzbb.hepgParton[npar] = i0part; myzbb.ptParton[npar] = pt_par; myzbb.ptParton[npar] = pt_par; myzbb.etaParton[npar] = eta_par; myzbb.etaParton[npar] = eta_par; myzbb.phiParton[npar] = phi_par; myzbb.phiParton[npar] = phi_par; } } // look for first b and bbbar for bbbar events // look for first b and bbbar for bbbar events if (idpart==5 && !foundb[0]) { if (idpart==5 && !foundb[0]) { float pt_par = sqrt( hepg.Px(partIter)*hepg.Px(partI float pt_par = sqrt( hepg.Px(partIter)*hepg.Px(partI hepg.Py(partIter)*hepg.Py(partI hepg.Py(partIter)*hepg.Py(partI float eta_par; float eta_par; float phi_par; float phi_par; if (pt_par!=0.) { | if (pt_par>ZERO) { eta_par = hepg.Pz(partIter)/pt_par; | eta_par = getEtaFromHEPG(hepg.Pz(partIter)/pt_par); eta_par = -log( - eta_par + sqrt(eta_par*eta_par+1. | phi_par = atan2(hepg.Py(partIter),hepg.Px(partIter) float phi_par = atan2(hepg.Py(partIter),hepg.Px(par < if (phi_par<0.) phi_par += 2.*3.1416; if (phi_par<0.) phi_par += 2.*3.1416; } else { } else { eta_par = 999.*hepg.Pz(partIter)/fabs(hepg.Pz(partI eta_par = 999.*hepg.Pz(partIter)/fabs(hepg.Pz(partI phi_par = 999.; phi_par = 999.; } } hepgb[0] = i0part; hepgb[0] = i0part; ptb[0] = pt_par; ptb[0] = pt_par; etab[0] = eta_par; etab[0] = eta_par; phib[0] = phi_par; phib[0] = phi_par; foundb[0] = true; foundb[0] = true; } else if (idpart==-5 && !foundb[1]) { } else if (idpart==-5 && !foundb[1]) { float pt_par = sqrt( hepg.Px(partIter)*hepg.Px(partI float pt_par = sqrt( hepg.Px(partIter)*hepg.Px(partI hepg.Py(partIter)*hepg.Py(partI hepg.Py(partIter)*hepg.Py(partI float eta_par; float eta_par; float phi_par; float phi_par; if (pt_par!=0.) { | if (pt_par>ZERO) { eta_par = hepg.Pz(partIter)/pt_par; | eta_par = getEtaFromHEPG(hepg.Pz(partIter)/pt_par); eta_par = -log( - eta_par + sqrt(eta_par*eta_par+1. < phi_par = atan2(hepg.Py(partIter),hepg.Px(partIter) phi_par = atan2(hepg.Py(partIter),hepg.Px(partIter) if (phi_par<0.) phi_par += 2.*3.1416; if (phi_par<0.) phi_par += 2.*3.1416; } else { } else { eta_par = 999.*hepg.Pz(partIter)/fabs(hepg.Pz(partI eta_par = 999.*hepg.Pz(partIter)/fabs(hepg.Pz(partI phi_par = 999.; phi_par = 999.; } } hepgb[1] = i0part; hepgb[1] = i0part; ptb[1] = pt_par; ptb[1] = pt_par; etab[1] = eta_par; etab[1] = eta_par; phib[1] = phi_par; phib[1] = phi_par; foundb[1] = true; foundb[1] = true; } } // keep leptons // keep leptons if ( abs(idpart)>=11 && abs(idpart)<=14 ) if ( abs(idpart)>=11 && abs(idpart)<=14 ) if (idpart!=hepg.idhep(i0mo1)) { if (idpart!=hepg.idhep(i0mo1)) { float pt_par = sqrt( hepg.Px(partIter)*hepg.Px(par float pt_par = sqrt( hepg.Px(partIter)*hepg.Px(par hepg.Py(partIter)*hepg.P hepg.Py(partIter)*hepg.P float eta_par = hepg.Pz(partIter)/pt_par; | float eta_par = (pt_par>ZERO) ? getEtaFromHEPG(hep eta_par = -log( - eta_par + sqrt(eta_par*eta_par+1. | float phi_par = (pt_par>ZERO) ? atan2(hepg.Py(part float phi_par = atan2(hepg.Py(partIter),hepg.Px(par < if (phi_par<0.) phi_par += 2.*3.1416; if (phi_par<0.) phi_par += 2.*3.1416; if (abs(idpart)==11) { if (abs(idpart)==11) { myzbb.hepgElectron[nele] = i0part; myzbb.hepgElectron[nele] = i0part; myzbb.ptElectron[nele] = pt_par; myzbb.ptElectron[nele] = pt_par; myzbb.etaElectron[nele] = eta_par; myzbb.etaElectron[nele] = eta_par; myzbb.phiElectron[nele] = phi_par; myzbb.phiElectron[nele] = phi_par; nele++; nele++; myzbb.ngele++; myzbb.ngele++; } else if (abs(idpart)==13) { } else if (abs(idpart)==13) { myzbb.hepgMuon[nmuo] = i0part; myzbb.hepgMuon[nmuo] = i0part; myzbb.ptMuon[nmuo] = pt_par; myzbb.ptMuon[nmuo] = pt_par; myzbb.etaMuon[nmuo] = eta_par; myzbb.etaMuon[nmuo] = eta_par; myzbb.phiMuon[nmuo] = phi_par; myzbb.phiMuon[nmuo] = phi_par; nmuo++; nmuo++; myzbb.ngmuo++; myzbb.ngmuo++; } else { } else { myzbb.hepgNeutrino[nneu] = i0part; myzbb.hepgNeutrino[nneu] = i0part; myzbb.ptNeutrino[nneu] = pt_par; myzbb.ptNeutrino[nneu] = pt_par; myzbb.etaNeutrino[nneu] = eta_par; myzbb.etaNeutrino[nneu] = eta_par; myzbb.phiNeutrino[nneu] = phi_par; myzbb.phiNeutrino[nneu] = phi_par; nneu++; nneu++; myzbb.ngneu++; myzbb.ngneu++; } } } } i0part++; i0part++; } } // If it is not a Z->bbbar event, fill parton variables w // If it is not a Z->bbbar event, fill parton variables w // info on first b and bbar in the event. // info on first b and bbar in the event. if (myzbb.hepgZ==-999) if (myzbb.hepgZ==-999) for (int np = 0; np<2; np++) { for (int np = 0; np<2; np++) { myzbb.hepgParton[np] = hepgb[np]; myzbb.hepgParton[np] = hepgb[np]; myzbb.ptParton[np] = ptb[np]; myzbb.ptParton[np] = ptb[np]; myzbb.etaParton[np] = etab[np]; myzbb.etaParton[np] = etab[np]; myzbb.phiParton[np] = phib[np]; myzbb.phiParton[np] = phib[np]; } } } } // Now we match partons and jets // Now we match partons and jets double dr[2][50]; double dr[2][50]; int cl[2][50]; int cl[2][50]; // compute dr // compute dr for (int i = 0; i<2; ++i) { for (int i = 0; i<2; ++i) { for (int j = 0; j3.14) dp = 6.28 - dp; if (dp>3.14) dp = 6.28 - dp; dr[i][j] = sqrt(dn*dn + dp*dp); dr[i][j] = sqrt(dn*dn + dp*dp); cl[i][j] = j; cl[i][j] = j; if (dr[i][j]>0.4) { if (dr[i][j]>0.4) { dr[i][j] = 100.; dr[i][j] = 100.; cl[i][j] = -999; cl[i][j] = -999; } } } } dr[i][myjet.njet] = 100.; dr[i][myjet.njet] = 100.; cl[i][myjet.njet] = -999; cl[i][myjet.njet] = -999; } } // reorder by dr // reorder by dr for (int i = 0; i<2; ++i) { for (int i = 0; i<2; ++i) { for (int j1 = 0; j13.14) dp = 6.28 - dp; if (dp>3.14) dp = 6.28 - dp; if (sqrt(dn*dn + dp*dp)3.14) dp = 6.28 - dp; if (dp>3.14) dp = 6.28 - dp; if (sqrt(dn*dn + dp*dp)3.14) dp = 6.28 - dp; if (dp>3.14) dp = 6.28 - dp; if (sqrt(dn*dn + dp*dp)