129 std::vector<HcalDDDRecConstants::HcalActiveLength>
actHB,
actHE;
151 else if (maxDepth_ < 1) maxDepth_ = 4;
164 << labelVtx_ <<
" " << labelEBRecHit_ <<
" " 165 << labelEERecHit_ <<
" " << labelHBHERecHit_
220 std::vector<int>
index;
221 for (
int i=0;
i<Ntriggers;
i++) {
223 int triggerSize =
int( _Triggers->
size());
226 <<
"\ntriggerSize " << triggerSize
229 if (index[i] < triggerSize) {
232 edm::LogInfo(
"HBHEMuon") <<
"Trigger_info " << triggerSize
233 <<
" triggerSize " << index[
i]
235 <<
" hltresult" << std::endl;
239 <<
"\" does not exist\n";
284 reco::VertexCollection::const_iterator firstGoodVertex = vtx->end();
285 for (reco::VertexCollection::const_iterator it = vtx->begin(); it != firstGoodVertex; it++) {
287 firstGoodVertex = it;
292 if (firstGoodVertex == vtx->end())
return;
297 for (reco::MuonCollection::const_iterator RecMuon = _Muon->begin(); RecMuon!= _Muon->end(); ++RecMuon) {
299 if (RecMuon->p() > 10.0) accept =
true;
308 pMuon_.push_back(RecMuon->p());
310 edm::LogInfo(
"HBHEMuon") <<
"Energy:" << RecMuon->energy() <<
" P:" 311 << RecMuon->p() << std::endl;
314 if (RecMuon->track().isNonnull()) {
315 trackerLayer_.push_back(RecMuon->track()->hitPattern().trackerLayersWithMeasurement());
319 if (RecMuon->innerTrack().isNonnull()) {
321 numPixelLayers_.push_back(RecMuon->innerTrack()->hitPattern().pixelLayersWithMeasurement());
322 chiTracker_.push_back(RecMuon->innerTrack()->normalizedChi2());
323 dxyTracker_.push_back(fabs(RecMuon->innerTrack()->dxy((*firstGoodVertex).position())));
324 dzTracker_.push_back(fabs(RecMuon->innerTrack()->dz((*firstGoodVertex).position())));
328 tight_PixelHits_.push_back(RecMuon->innerTrack()->hitPattern().numberOfValidPixelHits());
341 if (RecMuon->outerTrack().isNonnull()) {
346 outerTrackChi_.push_back(RecMuon->outerTrack()->normalizedChi2());
359 if (RecMuon->globalTrack().isNonnull()) {
361 chiGlobal_.push_back(RecMuon->globalTrack()->normalizedChi2());
362 globalMuonHits_.push_back(RecMuon->globalTrack()->hitPattern().numberOfValidMuonHits());
363 matchedStat_.push_back(RecMuon->numberOfMatchedStations());
367 tight_TransImpara_.push_back(fabs(RecMuon->muonBestTrack()->dxy((*firstGoodVertex).position())));
368 tight_LongPara_.push_back(fabs(RecMuon->muonBestTrack()->dz((*firstGoodVertex).position())));
381 isolationR04_.push_back(((RecMuon->pfIsolationR04().sumChargedHadronPt +
std::max(0.,RecMuon->pfIsolationR04().sumNeutralHadronEt + RecMuon->pfIsolationR04().sumPhotonEt - (0.5 *RecMuon->pfIsolationR04().sumPUPt))) / RecMuon->pt()) );
383 isolationR03_.push_back(((RecMuon->pfIsolationR03().sumChargedHadronPt +
std::max(0.,RecMuon->pfIsolationR03().sumNeutralHadronEt + RecMuon->pfIsolationR03().sumPhotonEt - (0.5 * RecMuon->pfIsolationR03().sumPUPt))) / RecMuon->pt()));
387 hoEnergy_.push_back(RecMuon->calEnergy().hoS9);
389 double eEcal(0), eHcal(0), activeLengthTot(0), activeLengthHotTot(0);
392 unsigned int isHot(0);
393 bool tmpmatch(
false);
395 eHcalDepth[
i] = eHcalDepthHot[
i] = activeL[
i] = activeHotL[
i] = -10000;
397 if (RecMuon->innerTrack().isNonnull()) {
398 const reco::Track* pTrack = (RecMuon->innerTrack()).
get();
411 bool okE = trackID.
okECAL;
414 std::pair<double,bool> e3x3 =
spr::eECALmatrix(isoCell,barrelRecHitsHandle,endcapRecHitsHandle,*theEcalChStatus,geo,caloTopology,sevlv.
product(),1,1,-100.0,-100.0,-500.0,500.0,
false);
419 edm::LogInfo(
"HBHEMuon") <<
"Propagate Track to ECAL: " << okE <<
":" 420 << trackID.
okECAL <<
" E " 421 << eEcal << std::endl;
427 if ((hcidt.ieta() == check.
ieta()) && (hcidt.iphi() == check.
iphi()))
433 bool hborhe = (
std::abs(ieta) == 16);
435 eHcal =
spr::eHCALmatrix(theHBHETopology, closestCell, hbhe,0,0,
false,
true, -100.0, -100.0, -100.0, -100.0, -500.,500.,
useRaw_);
436 std::vector<std::pair<double,int> > ehdepth;
437 spr::energyHCALCell((
HcalDetId) closestCell, hbhe, ehdepth,
maxDepth_, -100.0, -100.0, -100.0, -100.0, -500.0, 500.0,
useRaw_, (((
verbosity_/1000)%10)>0));
438 for (
unsigned int i=0;
i<ehdepth.size(); ++
i) {
439 eHcalDepth[ehdepth[
i].second-1] = ehdepth[
i].first;
443 activeL[ehdepth[
i].second-1] = actL;
444 activeLengthTot += actL;
447 edm::LogInfo(
"HBHEMuon") << hcid0 <<
" E " << ehdepth[
i].first
448 <<
" L " << actL << std::endl;
454 isHot =
matchId(closestCell,hotCell);
460 std::vector<std::pair<double,int> > ehdepth;
461 spr::energyHCALCell(hotCell, hbhe, ehdepth,
maxDepth_, -100.0, -100.0, -100.0, -100.0, -500.0, 500.0,
useRaw_,
false);
462 for (
unsigned int i=0;
i<ehdepth.size(); ++
i) {
463 eHcalDepthHot[ehdepth[
i].second-1] = ehdepth[
i].first;
467 activeHotL[ehdepth[
i].second-1] = actL;
468 activeLengthHotTot += actL;
471 edm::LogInfo(
"HBHEMuon") << hcid0 <<
" E " << ehdepth[
i].first
472 <<
" L " << actL << std::endl;
479 << trackID.
okHCAL <<
" Match " << tmpmatch
480 <<
" Hot " << isHot <<
" Energy " 481 << eHcal << std::endl;
526 if (accept)
tree_->Fill();
655 edm::LogInfo(
"HBHEMuon") <<
"HLT config with process name " 656 <<
"HLT" <<
" successfully extracted" 660 std::string string_search[6]={
"HLT_IsoMu17",
"HLT_IsoMu20",
"HLT_IsoMu24",
"HLT_IsoMu27",
"HLT_Mu45",
"HLT_Mu50"};
663 for (
unsigned int t=0;
t<ntriggers;++
t) {
665 for (
unsigned int ik=0; ik<6; ++ik) {
666 if (
hltname.find(string_search[ik])!=std::string::npos ){
672 edm::LogInfo(
"HBHEMuon") <<
"All triggers size in begin run " 675 edm::LogError(
"HBHEMuon") <<
"Error! HLT config extraction with process name " 676 <<
"HLT" <<
" failed";
789 int match = ((kd1 == kd2) ? 1 : 0);
795 int ieta =
id.ietaAbs();
796 int depth=
id.depth();
799 for (
unsigned int i=0;
i<
actHB.size(); ++
i) {
806 for (
unsigned int i=0;
i<
actHE.size(); ++
i) {
817 if (vtx.
isFake())
return false;
818 if (vtx.
ndof() < 4)
return false;
819 if (vtx.
position().Rho() > 2.)
return false;
820 if (fabs(vtx.
position().Z()) > 24.)
return false;
unsigned int size() const
number of trigger paths in trigger table
std::vector< double > hcalDepth1Energy_
std::vector< double > hcalDepth5EnergyHot_
std::vector< double > hcalDepth6Energy_
std::vector< double > hcalDepth7Energy_
T getParameter(std::string const &) const
EventNumber_t event() const
std::vector< double > innerTrackphi_
std::vector< double > hcalDepth7ActiveLengthHot_
HcalHBHEMuonAnalyzer(const edm::ParameterSet &)
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double > hcalDepth1ActiveLength_
std::vector< double > hcalDepth1EnergyHot_
unsigned int eventNumber_
virtual void beginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
std::vector< double > hcalHot_
std::vector< spr::propagatedTrackID > propagateCALO(edm::Handle< reco::TrackCollection > &trkCollection, const CaloGeometry *geo, const MagneticField *bField, std::string &theTrackQuality, bool debug=false)
std::vector< double > hcalDepth6ActiveLengthHot_
std::vector< double > dzTracker_
HcalSubdetector subdet() const
get the subdetector
const std::string & triggerName(unsigned int triggerIndex) const
virtual void endLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &)
edm::InputTag HLTriggerResults_
std::vector< double > outerTrackChi_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< double > matchedStat_
std::vector< double > tight_LongPara_
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< EcalRecHitCollection > tok_EE_
std::vector< unsigned int > ecalDetId_
std::vector< double > pMuon_
bool accept() const
Has at least one path accepted the event?
std::vector< double > globalTrckPhi_
std::vector< double > outerTrackHits_
double eHCALmatrix(const HcalTopology *topology, const DetId &det, edm::Handle< T > &hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
int bunchCrossing() const
T * make(const Args &...args) const
make new ROOT object
std::vector< double > hcalDepth5ActiveLengthHot_
std::vector< HcalDDDRecConstants::HcalActiveLength > actHE
std::vector< double > isolationR03_
std::vector< double > hcalDepth2Energy_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
LuminosityBlockNumber_t luminosityBlock() const
const Point & position() const
position
std::vector< bool > muon_global_
edm::EDGetTokenT< edm::TriggerResults > tok_trigRes_
std::string labelEBRecHit_
std::vector< double > outerTrackPt_
uint32_t rawId() const
get the raw id
U second(std::pair< T, U > const &p)
std::vector< double > hcalDepth4Energy_
edm::EDGetTokenT< reco::VertexCollection > tok_Vtx_
std::vector< double > globalTrckPt_
std::vector< double > hcalDepth2EnergyHot_
void addDefault(ParameterSetDescription const &psetDescription)
std::vector< bool > muon_tracker_
std::vector< double > ecalEnergy_
unsigned int triggerIndex(std::string const &name) const
std::vector< double > hcalDepth3ActiveLengthHot_
std::vector< double > hcalActiveLengthHot_
std::vector< double > innerTracketa_
std::vector< double > globalTrckEta_
std::vector< double > isolationR04_
std::vector< double > hcalDepth5ActiveLength_
std::vector< double > hcalDepth4EnergyHot_
std::vector< double > hcalDepth2ActiveLengthHot_
unsigned int size() const
Get number of paths stored.
std::vector< double > ptGlob_
std::vector< unsigned int > ehcalDetId_
int ieta() const
get the cell ieta
std::pair< bool, HcalDetId > propagateHCALBack(const reco::Track *, const CaloGeometry *geo, const MagneticField *bField, bool debug=false)
Abs< T >::type abs(const T &t)
std::vector< double > tight_PixelHits_
std::vector< double > hcalEnergy_
std::vector< double > trackerLayer_
std::vector< double > outerTrackEta_
void energyHCALCell(HcalDetId detId, edm::Handle< T > &hits, std::vector< std::pair< double, int > > &energyCell, int maxDepth=1, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false)
double activeLength(const DetId &)
std::vector< bool > globalTrack_
std::vector< double > outerTrackRHits_
std::vector< double > hcal1x1Energy_
edm::EDGetTokenT< reco::MuonCollection > tok_Muon_
virtual void endRun(edm::Run const &, edm::EventSetup const &)
std::vector< HcalActiveLength > getThickActive(const int type) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
std::vector< bool > muon_is_good_
std::vector< double > hcalDepth7ActiveLength_
int iphi() const
get the cell iphi
std::vector< double > hcalDepth4ActiveLengthHot_
std::vector< double > hcalDepth6ActiveLength_
std::vector< double > chiGlobal_
std::string labelHBHERecHit_
std::vector< HcalDDDRecConstants::HcalActiveLength > actHB
std::vector< unsigned int > hcalDetId_
std::vector< int > hltresults
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d'tor
std::vector< std::string > all_triggers
std::vector< double > globalMuonHits_
std::vector< double > hcalDepth3ActiveLength_
std::vector< double > hoEnergy_
std::vector< double > hcalDepth7EnergyHot_
std::vector< double > hcalDepth1ActiveLengthHot_
int matchId(const HcalDetId &, const HcalDetId &)
std::vector< double > phiGlob_
std::vector< double > hcalDepth2ActiveLength_
HLTConfigProvider hltConfig_
edm::EDGetTokenT< EcalRecHitCollection > tok_EB_
std::vector< double > hcalActiveLength_
std::vector< double > hcalDepth3Energy_
std::vector< double > chiTracker_
std::vector< double > matchedId_
virtual void beginRun(edm::Run const &, edm::EventSetup const &)
std::vector< double > hcalDepth5Energy_
std::vector< double > hcalDepth3EnergyHot_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
std::vector< double > hcalDepth6EnergyHot_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< bool > outerTrack_
std::string labelEERecHit_
std::vector< double > numPixelLayers_
edm::EDGetTokenT< HBHERecHitCollection > tok_HBHE_
edm::Service< TFileService > fs
std::vector< double > hcalDepth4ActiveLength_
T const * product() const
std::vector< double > dxyTracker_
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
std::vector< double > ecal3x3Energy_
std::vector< double > tight_TransImpara_
std::vector< double > energyMuon_
std::vector< double > etaGlob_
bool isGoodVertex(const reco::Vertex &vtx)
std::vector< double > outerTrackPhi_
std::vector< double > innerTrackpt_
std::vector< bool > innerTrack_
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)