123 if (!recVtxs->empty() && !((*recVtxs)[0].isFake())) {
124 leadPV =
math::XYZPoint( (*recVtxs)[0].
x(),(*recVtxs)[0].
y(), (*recVtxs)[0].
z() );
125 }
else if (beamSpotH.
isValid()) {
130 std::cout <<
"Primary Vertex " << leadPV;
135 std::vector<spr::propagatedTrackDirection> trkCaloDirections;
137 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
150 edm::SimTrackContainer::const_iterator simTrkItr;
159 std::unique_ptr<TrackerHitAssociator> associate;
171 for (trkDetItr = trkCaloDirections.begin(),nTracks=0; trkDetItr != trkCaloDirections.end(); trkDetItr++,nTracks++){
172 const reco::Track* pTrack = &(*(trkDetItr->trkItr));
174 int nRH_eMipDR=0, nRH_eDR=0, nNearTRKs=0, nRecHitsCone=-99;
175 double distFromHotCell=-99.0, distFromHotCell2=-99.0;
176 int ietaHotCell=-99, iphiHotCell=-99;
177 int ietaHotCell2=-99, iphiHotCell2=-99;
178 GlobalPoint gposHotCell(0.,0.,0.), gposHotCell2(0.,0.,0.);
179 std::vector<DetId> coneRecHitDetIds, coneRecHitDetIds2;
180 std::pair<double, bool> e11x11_20SigP, e15x15_20SigP;
182 trkDetItr->pointECAL,
183 a_coneR, trkDetItr->directionHCAL,
184 nRecHitsCone, coneRecHitDetIds,
185 distFromHotCell, ietaHotCell, iphiHotCell,
188 trkDetItr->pointECAL,
189 a_coneR, trkDetItr->directionHCAL,
190 nRecHitsCone, coneRecHitDetIds,
191 distFromHotCell, ietaHotCell,
192 iphiHotCell, gposHotCell,
196 trkDetItr->directionHCAL, nRecHitsCone,
197 coneRecHitDetIds2, distFromHotCell2,
198 ietaHotCell2, iphiHotCell2, gposHotCell2,
202 trkDetItr->directionHCAL, nRecHitsCone,
203 coneRecHitDetIds2, distFromHotCell2,
204 ietaHotCell2, iphiHotCell2,
210 endcapRecHitsHandle,trkDetItr->pointHCAL,
211 trkDetItr->pointECAL,
a_mipR,
212 trkDetItr->directionECAL, nRH_eMipDR);
214 endcapRecHitsHandle,trkDetItr->pointHCAL,
216 trkDetItr->directionECAL, nRH_eDR);
218 endcapRecHitsHandle,trkDetItr->pointHCAL,
219 trkDetItr->pointECAL,
a_mipR,
220 trkDetItr->directionECAL, nRH_eMipDR,
223 endcapRecHitsHandle,trkDetItr->pointHCAL,
225 trkDetItr->directionECAL, nRH_eDR,
228 endcapRecHitsHandle,trkDetItr->pointHCAL,
229 trkDetItr->pointECAL,
a_mipR,
230 trkDetItr->directionECAL, nRH_eMipDR,
233 endcapRecHitsHandle,trkDetItr->pointHCAL,
235 trkDetItr->directionECAL, nRH_eDR,
243 e11x11_20SigP =
spr::eECALmatrix(trkDetItr->detIdECAL,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.
product(),5,5, 0.060, 0.300,
tMinE_,
tMaxE_);
244 e15x15_20SigP =
spr::eECALmatrix(trkDetItr->detIdECAL,barrelRecHitsHandle,endcapRecHitsHandle, *theEcalChStatus, geo, caloTopology,sevlv.
product(),7,7, 0.060, 0.300,
tMinE_,
tMaxE_);
268 std::cout <<
"Track p " << pTrack->
p() <<
" pt " << pTrack->
pt()
269 <<
" eta " << pTrack->
momentum().eta() <<
" phi " 270 << pTrack->
momentum().phi() <<
" ieta/iphi (" 271 << closestCell.
ieta() <<
", " << closestCell.
iphi()
272 <<
") Energy in cone " << hCone <<
" Charge Isolation " 273 << conehmaxNearP <<
" eMIP (" << eMipDR <<
", " 274 << eMipDR_1 <<
", " << eMipDR_2 <<
")" 275 <<
" Neutral isolation (ECAL) (" << eECALDR-eMipDR <<
", " 276 << eECALDR_1-eMipDR_1 <<
", " << eECALDR_2-eMipDR_2 <<
")" 277 <<
" (ECAL NxN) " << e15x15_20SigP.first-e11x11_20SigP.first
278 <<
" (HCAL) " << eHCALDR-hCone << std::endl;
284 std::map<std::string, double> hsimInfo;
285 std::vector<int> multiplicity;
288 trkDetItr->directionHCAL, nSimHits);
289 hsimInfo = spr::eHCALSimInfoCone(iEvent, pcalohh, SimTk, SimVtx,
290 pTrack, *associate, geo,
291 trkDetItr->pointHCAL,
293 trkDetItr->directionHCAL,
311 t_hsim ->push_back(hsim );
315 std::cout <<
"Matched (E) " << hsimInfo[
"eMatched"] <<
" (N) " 316 << multiplicity.at(0) <<
" Rest (E) " << hsimInfo[
"eRest"]
317 <<
" (N) " << multiplicity.at(1) <<
" Gamma (E) " 318 << hsimInfo[
"eGamma"] <<
" (N) " << multiplicity.at(2)
319 <<
" Neutral Had (E) " << hsimInfo[
"eNeutralHad"]
320 <<
" (N) " << multiplicity.at(3) <<
" Charged Had (E) " 321 << hsimInfo[
"eChargedHad"] <<
" (N) " << multiplicity.at(4)
322 <<
" Total (E) " << hsimInfo[
"eTotal"] <<
" (N) " 323 << multiplicity.at(5) <<
" PDG " << hsimInfo[
"pdgMatched"]
324 <<
" Total E " << hsim <<
" NHit " << nSimHits <<std::endl;
double p() const
momentum vector magnitude
std::vector< double > * t_hsimInfoMatched
EventNumber_t event() const
std::vector< double > * t_eHCALDR
const unsigned int nTracks(const reco::Vertex &sv)
std::vector< int > * t_hsimInfoNRest
std::string theTrackQuality
std::vector< double > * t_hCone
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
std::vector< int > * t_hsimInfoNTotal
std::vector< int > * t_hsimInfoNCharHad
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEE_
TrackerHitAssociator::Config trackerHitAssociatorConfig_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< int > * t_hsimInfoNMatched
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
std::vector< double > * t_hsim
int bunchCrossing() const
std::vector< double > * t_hsimInfoNeutHad
edm::LuminosityBlockNumber_t luminosityBlock() const
std::vector< double > * t_eMipDR_2
std::vector< int > * t_hsimInfoNPhoton
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
const Vector & momentum() const
track momentum vector
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
std::vector< double > * t_e11x11_20Sig
std::vector< int > * t_hsimInfoNNeutHad
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloEB_
double pt() const
track transverse momentum
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
std::vector< double > * t_trackEta
int ieta() const
get the cell ieta
std::vector< double > * t_eECALDR_2
edm::EDGetTokenT< edm::SimTrackContainer > tok_simTk_
std::vector< double > * t_eECALDR
spr::trackSelectionParameters selectionParameters
double eCone_ecal(const CaloGeometry *geo, edm::Handle< T > &barrelhits, edm::Handle< T > &endcaphits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)
std::vector< double > * t_eMipDR_1
int iphi() const
get the cell iphi
std::vector< double > * t_trackPt
const MagneticField * bField
T const * product() const
std::vector< double > * t_trackHcalEta
std::vector< double > * t_trackP
std::vector< double > * t_eECALDR_1
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< double > * t_trackHcalPhi
std::vector< double > * t_hsimInfoPhoton
std::vector< double > * t_hsimInfoTotal
edm::EDGetTokenT< edm::PCaloHitContainer > tok_caloHH_
std::vector< double > * t_hsimInfoCharHad
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
std::vector< double > * t_trackPhi
const Point & position() const
position
std::vector< double > * t_eHCALDRHB
std::vector< double > * t_hsimInfoPdgMatched
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
edm::EDGetTokenT< edm::SimVertexContainer > tok_simVtx_
T const * product() const
std::vector< int > * t_nSimHits
std::vector< double > * t_hConeHB
std::vector< double > * t_hsimInfoRest
std::vector< double > * t_conehmaxNearP
std::vector< double > * t_e15x15_20Sig
double eCone_hcal(const CaloGeometry *geo, edm::Handle< T > &hits, const GlobalPoint &hpoint1, const GlobalPoint &point1, double dR, const GlobalVector &trackMom, int &nRecHits, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, int detOnly=-1, bool useRaw=false, bool debug=false)
std::vector< double > * t_eMipDR
double eECALmatrix(const DetId &detId, edm::Handle< T > &hitsEB, edm::Handle< T > &hitsEE, const CaloGeometry *geo, const CaloTopology *caloTopology, int ieta, int iphi, double ebThr=-100, double eeThr=-100, double tMin=-500, double tMax=500, bool debug=false)