#ifndef STNTUPLE_PHOTON_TPhotonUtil_hh #define STNTUPLE_PHOTON_TPhotonUtil_hh class TStnTrack; class TStnPhoton; class TStnPhotonBlock; class TStnElectron; class TStnJet; class TStnEvent; class TStnTrackBlock; class TStnTriggerBlock; class TClonesArray; class TPhotonUtil: public TObject { public: // match a L2 cluster to a detector eta and phi // pass is L2 pass number // clusOrIso = 0 = return index to TTl2d::Cluster(i) // clusOrIso = 1 = return index to TTl2d::ClusterIso(i) static Int_t L2ClusterMatch(Double_t eta, Double_t phi, TStnTriggerBlock* trigBlock, int pass = 1, int clusOrIso = 0); // Correct photon quantites for a new z vertex. Track list is needed for // Track iso, can be retrieved from TrackBlock or set to NULL (iso=999.0) static Int_t SetPhotonZ(TStnPhoton* pho, Double_t z = 0, TClonesArray* trackList = NULL); static Int_t SetAllPhotonZ(TStnEvent* event, Double_t z = 0); //add PPR energy and other corrections for 5.3.3 // only call this once since it modifies the PhotonBlock contents static Int_t CorrectPhotonEnergy(TStnEvent* event); // fix the isolation energy correction vs the number of vertices // only for dev_242 and dev_243_01 // only call this once since it modifies the PhotonBlock contents static Int_t CorrectPhotonIsolation(TStnEvent* event); static Double_t TrkIsoSum1(TStnTrack* track, TClonesArray* trackList, Double_t cone = 0.4, Double_t dz = 5.0, TStnTrack* skipTrack = NULL); static Double_t TrkIsoSum0(Double_t phi, Double_t eta, Double_t z, TClonesArray* trackList, Double_t cone = 0.4, Double_t dz = 5.0, TStnTrack* skipTrack = NULL); static Int_t DumpPhotons(TStnEvent* event, Float_t PhotonEt=0.0); static Double_t ExpectedHadEm(Double_t energy); // deltax between expected CPR hit and nearest track static Double_t CprTrack(TStnPhoton* pho, TStnTrackBlock* tblk); // returns true if a good vertex was found // return false and z=0 if no vertex, false and z=vertex if |z|>60cm. // nv12=nzv withclass>12 for jet corr static Bool_t SelectVertex(TStnEvent* event, Float_t& z, Int_t& nv12, int minClass = 12, bool useVxprimToo = false); // find matching object static TStnJet* MatchJet(TStnEvent* event, TStnPhoton* pho); static TStnElectron* MatchElectron(TStnEvent* event, TStnPhoton* pho); static TStnElectron* MatchPhoenixElectron(TStnEvent* event, TStnPhoton* pho); static TStnElectron* MatchPhoenixElectron(TStnEvent* event, TStnElectron* ele); static TStnPhoton* MatchPhoton(TStnEvent* event, TStnElectron* pho); // number of Phoenix hits in trajectory for a TStnElectron from TPhoenixBlock static Int_t PhoenixHits(TStnEvent* event, TStnElectron* pele, Int_t& nHit, Int_t& nHitPhi); static TStnTrack* PhoenixTrack(TStnEvent* event, TStnElectron* pele); // give this routine an uncorr jet Et and it returns // an array of 15 smeared fake photon Et's and weights // for(int i=0; i<15; i++) hist.Fill(quantity such as bgEt[i], bgWht[i]); // uses numbers from Helen from 7/2004 (for gen4, dev_240), verified 2/2005 // mode =0 for central value, -1 for -1sigma, +1 for +1sigma static void PhoBgWeights(Float_t jetEt, Float_t* bgEt, Float_t* bgWht, int mode=0); // find the distance to the edge of the hit CPR2 pad // zCPR= CDFz at CPR, phiGlobal=CDF phi // returns distance to center of nearest pad static Int_t cp2_close_pad( Float_t zCPR, Float_t phiGlobal, Float_t &delx, Float_t &delz); ClassDef(TPhotonUtil,0) }; #endif