|
|
Go to the documentation of this file.
13 #include <boost/regex.hpp>
91 return std::make_unique<AlCaIsoTracks::Counters>();
103 const std::vector<std::string>& triggerNames_,
155 theTrackQuality_(iConfig.getParameter<
std::
string>(
"trackQuality")),
156 processName_(iConfig.getParameter<
std::
string>(
"processName")),
157 a_coneR_(iConfig.getParameter<double>(
"coneRadius")),
158 a_mipR_(iConfig.getParameter<double>(
"coneRadiusMIP")),
159 maxRestrictionP_(iConfig.getParameter<double>(
"maxTrackP")),
160 slopeRestrictionP_(iConfig.getParameter<double>(
"slopeTrackP")),
161 pTrackMin_(iConfig.getParameter<double>(
"minimumTrackP")),
162 eEcalMax_(iConfig.getParameter<double>(
"maximumEcalEnergy")),
163 eIsolate_(iConfig.getParameter<double>(
"isolationEnergy")),
164 pTrackLow_(iConfig.getParameter<double>(
"momentumRangeLow")),
165 pTrackHigh_(iConfig.getParameter<double>(
"momentumRangeHigh")),
166 preScale_(iConfig.getParameter<
int>(
"preScaleFactor")),
167 labelGenTrack_(iConfig.getParameter<
edm::
InputTag>(
"TrackLabel")),
168 labelRecVtx_(iConfig.getParameter<
edm::
InputTag>(
"VertexLabel")),
169 labelBS_(iConfig.getParameter<
edm::
InputTag>(
"BeamSpotLabel")),
170 labelEB_(iConfig.getParameter<
edm::
InputTag>(
"EBRecHitLabel")),
171 labelEE_(iConfig.getParameter<
edm::
InputTag>(
"EERecHitLabel")),
172 labelHBHE_(iConfig.getParameter<
edm::
InputTag>(
"HBHERecHitLabel")),
173 labelHltGT_(iConfig.getParameter<
edm::
InputTag>(
"L1GTSeedLabel")),
174 labelTriggerEvent_(iConfig.getParameter<
edm::
InputTag>(
"TriggerEventLabel")),
175 labelTriggerResults_(iConfig.getParameter<
edm::
InputTag>(
"TriggerResultLabel")),
176 labelIsoTk_(iConfig.getParameter<
std::
string>(
"IsoTrackLabel")) {
183 const double isolationRadius(28.9);
208 tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord, edm::Transition::BeginRun>();
209 tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord, edm::Transition::BeginRun>();
232 produces<reco::HcalIsolatedTrackCandidateCollection>(
labelIsoTk_);
238 edm::LogVerbatim(
"HcalIsoTrack") <<
" Expected to produce the collections:\n"
239 <<
"reco::HcalIsolatedTrackCandidateCollection "
240 <<
" with label HcalIsolatedTrackCollection\n"
242 <<
"EcalRecHitCollection with label EcalRecHitsEB\n"
243 <<
"EcalRecHitCollection with label EcalRecHitsEE\n"
262 std::vector<std::string> triggers = {
"HLT_IsoTrackHB",
"HLT_IsoTrackHE"};
263 desc.add<std::vector<std::string> >(
"triggers", triggers);
267 desc.add<
double>(
"minTrackPt", 1.0);
268 desc.add<
double>(
"maxDxyPV", 10.0);
269 desc.add<
double>(
"maxDzPV", 100.0);
270 desc.add<
double>(
"maxChi2", 5.0);
271 desc.add<
double>(
"maxDpOverP", 0.1);
272 desc.add<
int>(
"minOuterHit", 4);
273 desc.add<
int>(
"minLayerCrossed", 8);
274 desc.add<
int>(
"maxInMiss", 2);
275 desc.add<
int>(
"maxOutMiss", 2);
277 desc.add<
double>(
"coneRadius", 34.98);
278 desc.add<
double>(
"minimumTrackP", 20.0);
280 desc.add<
double>(
"coneRadiusMIP", 14.0);
281 desc.add<
double>(
"maximumEcalEnergy", 2.0);
283 desc.add<
double>(
"maxTrackP", 8.0);
284 desc.add<
double>(
"slopeTrackP", 0.05090504066);
285 desc.add<
double>(
"isolationEnergy", 10.0);
287 desc.add<
double>(
"momentumRangeLow", 20.0);
288 desc.add<
double>(
"momentumRangeHigh", 40.0);
289 desc.add<
int>(
"preScaleFactor", 10);
290 descriptions.
add(
"alcaisotrk",
desc);
297 <<
iEvent.luminosityBlock() <<
" Bunch " <<
iEvent.bunchCrossing();
304 if (!triggerEventHandle.
isValid()) {
317 if (!trkCollection.
isValid()) {
333 if (!recVtxs->empty() && !((*recVtxs)[0].isFake())) {
334 leadPV =
math::XYZPoint((*recVtxs)[0].
x(), (*recVtxs)[0].
y(), (*recVtxs)[0].
z());
335 }
else if (beamSpotH.
isValid()) {
345 if (!barrelRecHitsHandle.
isValid()) {
351 if (!endcapRecHitsHandle.
isValid()) {
357 if (!
hbhe.isValid()) {
363 double ptL1(0), etaL1(0), phiL1(0);
368 std::vector<edm::Ref<l1extra::L1JetParticleCollection> > l1tauobjref;
372 std::vector<edm::Ref<l1extra::L1JetParticleCollection> > l1jetobjref;
376 std::vector<edm::Ref<l1extra::L1JetParticleCollection> > l1forjetobjref;
383 auto outputHcalIsoTrackColl = std::make_unique<reco::HcalIsolatedTrackCandidateCollection>();
384 auto outputVColl = std::make_unique<reco::VertexCollection>();
385 auto outputEBColl = std::make_unique<EBRecHitCollection>();
386 auto outputEEColl = std::make_unique<EERecHitCollection>();
387 auto outputHBHEColl = std::make_unique<HBHERecHitCollection>();
391 edm::LogWarning(
"HcalIsoTrack") <<
"Error! Can't get some of the products";
396 const std::vector<std::string>& triggerNames_ =
triggerNames.triggerNames();
408 edm::LogVerbatim(
"HcalIsoTrack") <<
"AlCaIsoTracksProducer::select returns " << isotk->size()
409 <<
" isolated tracks";
412 if (!isotk->empty()) {
413 int ntrin(0), ntrout(0);
414 for (reco::HcalIsolatedTrackCandidateCollection::const_iterator itr = isotk->begin(); itr != isotk->end();
421 bool selectEvent = ntrout > 0;
422 if (!selectEvent && ntrin > 0) {
430 for (reco::HcalIsolatedTrackCandidateCollection::const_iterator itr = isotk->begin(); itr != isotk->end();
432 outputHcalIsoTrackColl->push_back(*itr);
434 for (reco::VertexCollection::const_iterator
vtx = recVtxs->begin();
vtx != recVtxs->end(); ++
vtx)
435 outputVColl->push_back(*
vtx);
438 ehit != barrelRecHitsHandle->
end();
440 outputEBColl->push_back(*ehit);
443 ehit != endcapRecHitsHandle->
end();
445 outputEEColl->push_back(*ehit);
447 for (std::vector<HBHERecHit>::const_iterator hhit =
hbhe->begin(); hhit !=
hbhe->end(); ++hhit)
448 outputHBHEColl->push_back(*hhit);
462 globalCache()->nAll_ +=
nAll_;
463 globalCache()->nGood_ +=
nGood_;
464 globalCache()->nRange_ +=
nRange_;
469 <<
count->nRange_ <<
" events in the momentum raange";
488 const std::vector<std::string>& triggerNames_,
501 for (
unsigned int iHLT = 0; iHLT <
triggerResults->size(); iHLT++) {
508 edm::LogVerbatim(
"HcalIsoTrack") <<
"The trigger we are looking for " << triggerNames_[iHLT] <<
" Flag " <<
hlt
515 std::vector<spr::propagatedTrackDirection> trkCaloDirections;
518 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
519 unsigned int nTracks(0), nselTracks(0);
520 for (trkDetItr = trkCaloDirections.begin(),
nTracks = 0; trkDetItr != trkCaloDirections.end();
522 const reco::Track* pTrack = &(*(trkDetItr->trkItr));
526 << pTrack->
eta() <<
"|" << pTrack->
phi() <<
"|" << pTrack->
p();
531 edm::LogVerbatim(
"HcalIsoTrack") <<
"qltyFlag|okECAL|okHCAL : " << qltyFlag <<
"|" << trkDetItr->okECAL <<
"|"
532 << trkDetItr->okHCAL;
534 if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) {
535 double t_p = pTrack->
p();
537 int nRH_eMipDR(0), nNearTRKs(0);
541 trkDetItr->pointHCAL,
542 trkDetItr->pointECAL,
544 trkDetItr->directionECAL,
554 << pTrack->
eta() <<
"|" << pTrack->
phi() <<
"|" << t_p <<
" e_MIP " << eMipDR
555 <<
" Chg Isolation " << hmaxNearP <<
":" << eIsolation;
559 newCandidate.
SetMaxP(hmaxNearP);
561 newCandidate.
setL1(ptL1, etaL1, phiL1);
562 newCandidate.
SetEtaPhiEcal((trkDetItr->pointECAL).eta(), (trkDetItr->pointECAL).
phi());
565 (trkDetItr->pointHCAL).eta(), (trkDetItr->pointHCAL).
phi(), detId.
ieta(), detId.
iphi());
567 for (reco::TrackCollection::const_iterator trkItr1 = trkCollection->begin(); trkItr1 != trkCollection->end();
570 if (pTrack1 == pTrack) {
587 for (
unsigned int p = 0;
p < objref.size();
p++) {
588 if (objref[
p]->
pt() > ptL1) {
589 ptL1 = objref[
p]->pt();
590 phiL1 = objref[
p]->phi();
591 etaL1 = objref[
p]->eta();
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
void SetEtaPhiEcal(double eta, double phi)
eta, phi at ECAL surface
void setL1(double pt, double eta, double phi)
std::vector< T >::const_iterator const_iterator
T const * product() const
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
const edm::InputTag labelRecVtx_
constexpr int iphi() const
get the cell iphi
double p() const
momentum vector magnitude
const edm::InputTag labelEE_
const double slopeRestrictionP_
void endRun(edm::Run const &, edm::EventSetup const &) override
HLTConfigProvider hltConfig_
void SetEtaPhiHcal(double eta, double phi, int ieta, int iphi)
eta, phi at HCAL surface
reco::HcalIsolatedTrackCandidateCollection * select(edm::Handle< edm::TriggerResults > &triggerResults, const std::vector< std::string > &triggerNames_, edm::Handle< reco::TrackCollection > &trkCollection, math::XYZPoint &leadPV, edm::Handle< EcalRecHitCollection > &barrelRecHitsHandle, edm::Handle< EcalRecHitCollection > &endcapRecHitsHandle, edm::Handle< HBHERecHitCollection > &hbhe, double ptL1, double etaL1, double phiL1)
const edm::InputTag labelBS_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > tok_hltGT_
static const std::string triggerResults
std::atomic< unsigned int > nGood_
double px() const
x coordinate of momentum vector
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
AlCaIsoTracksProducer(edm::ParameterSet const &, const AlCaIsoTracks::Counters *count)
static void globalEndJob(const AlCaIsoTracks::Counters *counters)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
const edm::InputTag labelHBHE_
Log< level::Warning, false > LogWarning
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
const std::string labelIsoTk_
double pt() const
track transverse momentum
const edm::InputTag labelHltGT_
const caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple cms::cuda::AtomicPairCounter const GPUCACell *__restrict__ const uint32_t *__restrict__ const gpuPixelDoublets::CellNeighborsVector const gpuPixelDoublets::CellTracksVector const GPUCACell::OuterHitOfCell *__restrict__ uint32_t uint32_t CAHitNtupletGeneratorKernelsGPU::Counters * counters
#define DEFINE_FWK_MODULE(type)
std::atomic< unsigned int > nRange_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
double py() const
y coordinate of momentum vector
const_iterator begin() const
void produce(edm::Event &, edm::EventSetup const &) override
spr::trackSelectionParameters selectionParameter_
void endStream() override
~AlCaIsoTracksProducer() override
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
const Point & position() const
position
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
void setTrack(const reco::TrackRef &tr)
const edm::InputTag labelEB_
double phi() const
azimuthal angle of momentum vector
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
std::vector< HcalIsolatedTrackCandidate > HcalIsolatedTrackCandidateCollection
collectin of HcalIsolatedTrackCandidate objects
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt_
constexpr int ieta() const
get the cell ieta
const edm::InputTag labelTriggerEvent_
XYZPointD XYZPoint
point in space with cartesian internal representation
const_iterator end() const
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
double eta() const
pseudorapidity of momentum vector
const double maxRestrictionP_
The single EDProduct to be saved for each event (AOD case)
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
reco::TrackBase::TrackQuality minQuality
const std::vector< std::string > trigNames_
bool getData(T &iHolder) const
void beginRun(edm::Run const &, edm::EventSetup const &) override
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
static TrackQuality qualityByName(const std::string &name)
const std::string processName_
const std::string theTrackQuality_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
void setPtEtaPhi(std::vector< edm::Ref< l1extra::L1JetParticleCollection > > &objref, double &ptL1, double &etaL1, double &phiL1)
static std::unique_ptr< AlCaIsoTracks::Counters > initializeGlobalCache(edm::ParameterSet const &)
Log< level::Info, true > LogVerbatim
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
std::atomic< unsigned int > nAll_
const edm::InputTag labelTriggerResults_
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
double pz() const
z coordinate of momentum vector
const edm::InputTag labelGenTrack_
constexpr int ietaAbs() const
get the absolute value of the cell ieta
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)
void SetEnergyEcal(double a)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_magField_
const MagneticField * bField