|
|
Go to the documentation of this file.
14 #include "TDirectory.h"
17 #include "TLorentzVector.h"
18 #include "TInterpreter.h"
132 usesResource(
"TFileService");
134 const double isolationRadius(28.9);
182 std::cout <<
"Parameters read from config file \n"
211 <<
iEvent.bunchCrossing() <<
" starts ==========" << std::endl;
247 if (!recVtxs->empty() && !((*recVtxs)[0].isFake())) {
248 leadPV =
math::XYZPoint((*recVtxs)[0].
x(), (*recVtxs)[0].
y(), (*recVtxs)[0].
z());
249 }
else if (beamSpotH.
isValid()) {
254 std::cout <<
"Primary Vertex " << leadPV;
270 bool triggerOK =
false;
277 if (!triggerEventHandle.
isValid()) {
287 const std::vector<std::string> &triggerNames_ =
triggerNames.triggerNames();
288 for (
unsigned int iHLT = 0; iHLT <
triggerResults->size(); iHLT++) {
296 std::cout <<
"This is the trigger we are looking for " << triggerNames_[iHLT] <<
" Flag " <<
hlt
309 std::vector<spr::propagatedTrackDirection> trkCaloDirections;
312 std::vector<spr::propagatedTrackDirection>::const_iterator trkDetItr;
313 unsigned int nTracks(0), nselTracks(0);
314 t_nTrk = trkCaloDirections.size();
316 for (trkDetItr = trkCaloDirections.begin(),
nTracks = 0; trkDetItr != trkCaloDirections.end();
318 const reco::Track *pTrack = &(*(trkDetItr->trkItr));
321 std::cout <<
"This track : " <<
nTracks <<
" (pt/eta/phi/p) :" << pTrack->
pt() <<
"/" << pTrack->
eta() <<
"/"
322 << pTrack->
phi() <<
"/" << pTrack->
p() << std::endl;
326 if (trkDetItr->okHCAL) {
338 oneCutParameters.
maxDzPV = 100;
344 oneCutParameters.
maxDzPV = 100;
353 std::cout <<
"qltyFlag|okECAL|okHCAL : " << qltyFlag <<
"|" << trkDetItr->okECAL <<
"/" << trkDetItr->okHCAL
356 if (qltyFlag && trkDetItr->okECAL && trkDetItr->okHCAL) {
358 int nRH_eMipDR(0), nNearTRKs(0);
363 trkDetItr->pointHCAL,
364 trkDetItr->pointECAL,
366 trkDetItr->directionECAL,
381 int nRecHits(-999), nRecHits1(-999), nRecHits3(-999);
382 std::vector<DetId> ids, ids1, ids3;
386 trkDetItr->pointHCAL,
387 trkDetItr->pointECAL,
389 trkDetItr->directionHCAL,
394 for (
unsigned int k = 0;
k < ids.size(); ++
k) {
400 trkDetItr->pointHCAL,
401 trkDetItr->pointECAL,
403 trkDetItr->directionHCAL,
408 for (
unsigned int k = 0;
k < ids1.size(); ++
k) {
414 trkDetItr->pointHCAL,
415 trkDetItr->pointECAL,
417 trkDetItr->directionHCAL,
422 for (
unsigned int k = 0;
k < ids3.size(); ++
k) {
431 std::cout <<
"This track : " <<
nTracks <<
" (pt/eta/phi/p) :" << pTrack->
pt() <<
"/" << pTrack->
eta()
432 <<
"/" << pTrack->
phi() <<
"/" <<
t_p << std::endl;
436 for (
unsigned int lll = 0; lll <
t_DetIds->size(); lll++) {
438 <<
" hit enery is = " <<
t_HitEnergies->at(lll) << std::endl;
457 tree->Branch(
"t_Run", &
t_Run,
"t_Run/I");
462 tree->Branch(
"t_p", &
t_p,
"t_p/D");
463 tree->Branch(
"t_pt", &
t_pt,
"t_pt/D");
465 tree->Branch(
"t_phi", &
t_phi,
"t_phi/D");
475 t_DetIds =
new std::vector<unsigned int>();
476 t_DetIds1 =
new std::vector<unsigned int>();
477 t_DetIds3 =
new std::vector<unsigned int>();
482 tree->Branch(
"t_DetIds",
"std::vector<unsigned int>", &
t_DetIds);
495 <<
" change flag " << changed_;
500 edm::LogInfo(
"HcalIsoTrack") <<
"New trigger menu found !!!";
502 for (
unsigned itrig = 0; itrig <
trigNames_.size(); itrig++) {
504 if (triggerindx >=
n) {
506 <<
"the current menu";
T const * product() const
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
edm::EDGetTokenT< reco::VertexCollection > tok_recVtx_
const unsigned int nTracks(const reco::Vertex &sv)
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
std::vector< unsigned int > * t_DetIds3
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
std::vector< unsigned int > * t_DetIds
double p() const
momentum vector magnitude
std::vector< unsigned int > * t_DetIds1
edm::EDGetTokenT< GenEventInfoProduct > tok_ew_
std::vector< double > * t_HitEnergies1
static const std::string triggerResults
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
void analyze(edm::Event const &, edm::EventSetup const &) override
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
TrackQuality
track quality
edm::EDGetTokenT< reco::BeamSpot > tok_bs_
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
T getUntrackedParameter(std::string const &, T const &) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
spr::trackSelectionParameters selectionParameters_
double pt() const
track transverse momentum
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HLTConfigProvider hltConfig_
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< trigger::TriggerEvent > tok_trigEvt_
const Point & position() const
position
double chargeIsolationCone(unsigned int trkIndex, std::vector< spr::propagatedTrackDirection > &trkDirs, double dR, int &nNearTRKs, bool debug=false)
double phi() const
azimuthal angle of momentum vector
std::vector< std::string > HLTNames_
unsigned int size() const
number of trigger paths in trigger table
constexpr int ieta() const
get the cell ieta
XYZPointD XYZPoint
point in space with cartesian internal representation
double eta() const
pseudorapidity of momentum vector
void endRun(edm::Run const &, edm::EventSetup const &) override
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)
edm::Service< TFileService > fs_
The single EDProduct to be saved for each event (AOD case)
reco::TrackBase::TrackQuality minQuality
unsigned int triggerIndex(const std::string &triggerName) const
slot position of trigger path in trigger table (0 to size-1)
~IsoTrackCalibration() 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)
edm::InputTag triggerEvent_
edm::EDGetTokenT< reco::TrackCollection > tok_genTrack_
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
void beginRun(edm::Run const &, edm::EventSetup const &) override
std::vector< std::string > trigNames_
double maxNeighborTrackEnr_
std::vector< double > * t_HitEnergies
std::string theTrackQuality_
std::vector< double > * t_HitEnergies3
Abs< T >::type abs(const T &t)
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 addDefault(ParameterSetDescription const &psetDescription)
IsoTrackCalibration(const edm::ParameterSet &)
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
T * make(const Args &... args) const
make new ROOT object
edm::InputTag theTriggerResultsLabel_