11 #include "TDirectory.h" 14 #include "TLorentzVector.h" 15 #include "TInterpreter.h" 130 usesResource(
"TFileService");
132 const double isolationRadius(28.9);
196 tok_geom_ = esConsumes<CaloGeometry, CaloGeometryRecord>();
197 tok_magField_ = esConsumes<MagneticField, IdealMagneticFieldRecord>();
210 <<
iEvent.luminosityBlock() <<
" Bunch " <<
iEvent.bunchCrossing()
211 <<
" starts ==========";
239 if (!recVtxs->empty() && !((*recVtxs)[0].isFake())) {
240 leadPV =
math::XYZPoint((*recVtxs)[0].
x(), (*recVtxs)[0].
y(), (*recVtxs)[0].
z());
241 }
else if (beamSpotH.
isValid()) {
259 bool triggerOK =
false;
266 if (!triggerEventHandle.
isValid()) {
274 const std::vector<std::string> &triggerNames_ =
triggerNames.triggerNames();
275 for (
unsigned int iHLT = 0; iHLT <
triggerResults->size(); iHLT++) {
283 <<
"This is the trigger we are looking for " << triggerNames_[iHLT] <<
" Flag " <<
hlt;
294 std::vector<spr::propagatedTrackDirection> trkCaloDirections;
297 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
299 t_nTrk = trkCaloDirections.size();
301 for (trkDetItr = trkCaloDirections.begin(),
nTracks = 0; trkDetItr != trkCaloDirections.end();
303 const reco::Track *pTrack = &(*(trkDetItr->trkItr));
306 << pTrack->
eta() <<
"/" << pTrack->
phi() <<
"/" << pTrack->
p();
309 if (trkDetItr->okHCAL) {
321 oneCutParameters.
maxDzPV = 100;
327 oneCutParameters.
maxDzPV = 100;
335 edm::LogVerbatim(
"IsoTrack") <<
"qltyFlag|okECAL|okHCAL : " << qltyFlag <<
"|" << trkDetItr->okECAL <<
"/" 336 << trkDetItr->okHCAL;
337 if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) {
338 int nRH_eMipDR(0), nNearTRKs(0);
343 trkDetItr->pointHCAL,
344 trkDetItr->pointECAL,
346 trkDetItr->directionECAL,
361 int nRecHits(-999), nRecHits1(-999), nRecHits3(-999);
362 std::vector<DetId> ids, ids1, ids3;
366 trkDetItr->pointHCAL,
367 trkDetItr->pointECAL,
369 trkDetItr->directionHCAL,
374 for (
unsigned int k = 0;
k < ids.size(); ++
k) {
380 trkDetItr->pointHCAL,
381 trkDetItr->pointECAL,
383 trkDetItr->directionHCAL,
388 for (
unsigned int k = 0;
k < ids1.size(); ++
k) {
394 trkDetItr->pointHCAL,
395 trkDetItr->pointECAL,
397 trkDetItr->directionHCAL,
402 for (
unsigned int k = 0;
k < ids3.size(); ++
k) {
411 << pTrack->
eta() <<
"/" << pTrack->
phi() <<
"/" <<
t_p;
415 for (
unsigned int lll = 0; lll <
t_DetIds->size(); lll++) {
435 tree->Branch(
"t_Run", &
t_Run,
"t_Run/I");
440 tree->Branch(
"t_p", &
t_p,
"t_p/D");
441 tree->Branch(
"t_pt", &
t_pt,
"t_pt/D");
443 tree->Branch(
"t_phi", &
t_phi,
"t_phi/D");
453 t_DetIds =
new std::vector<unsigned int>();
454 t_DetIds1 =
new std::vector<unsigned int>();
455 t_DetIds3 =
new std::vector<unsigned int>();
460 tree->Branch(
"t_DetIds",
"std::vector<unsigned int>", &
t_DetIds);
473 <<
" change flag " << changed_;
477 edm::LogInfo(
"HcalIsoTrack") <<
"New trigger menu found !!!";
479 for (
unsigned itrig = 0; itrig <
trigNames_.size(); itrig++) {
481 if (triggerindx >=
n) {
483 <<
"the current menu";
std::vector< double > * t_HitEnergies3
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, int useRaw=0, bool debug=false)
Log< level::Info, true > LogVerbatim
edm::InputTag triggerEvent_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, const std::string &theTrackQuality, bool debug=false)
edm::InputTag theTriggerResultsLabel_
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
The single EDProduct to be saved for each event (AOD case)
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
const Point & position() const
position
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > tok_geom_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
TrackQuality
track quality
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > tok_magField_
void beginRun(edm::Run const &, edm::EventSetup const &) override
double p() const
momentum vector magnitude
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt_
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
std::vector< unsigned int > * t_DetIds1
std::vector< unsigned int > * t_DetIds3
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
double maxNeighborTrackEnr_
T getUntrackedParameter(std::string const &, T const &) const
double pt() const
track transverse momentum
void addDefault(ParameterSetDescription const &psetDescription)
std::vector< std::string > HLTNames_
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
unsigned int size() const
number of trigger paths in trigger table
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
Abs< T >::type abs(const T &t)
double phi() const
azimuthal angle of momentum vector
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)
#define DEFINE_FWK_MODULE(type)
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
static std::string const triggerResults
IsoTrackCalibration(const edm::ParameterSet &)
std::vector< double > * t_HitEnergies
std::vector< std::string > trigNames_
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
Log< level::Info, false > LogInfo
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
double eta() const
pseudorapidity of momentum vector
static TrackQuality qualityByName(const std::string &name)
XYZPointD XYZPoint
point in space with cartesian internal representation
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
std::string theTrackQuality_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
void analyze(edm::Event const &, edm::EventSetup const &) override
spr::trackSelectionParameters selectionParameters_
reco::TrackBase::TrackQuality minQuality
void endRun(edm::Run const &, edm::EventSetup const &) override
~IsoTrackCalibration() override
T * make(const Args &...args) const
make new ROOT object
Log< level::Warning, false > LogWarning
edm::Service< TFileService > fs_
std::vector< double > * t_HitEnergies1
std::vector< unsigned int > * t_DetIds
HLTConfigProvider hltConfig_
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_