CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
CSCSkim Class Reference

#include <RecoLocalMuon/CSCSkim/src/CSCSkim.cc>

Inheritance diagram for CSCSkim:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob () override
 
 CSCSkim (const edm::ParameterSet &pset)
 
void endJob () override
 
bool filter (edm::Event &event, const edm::EventSetup &eventSetup) override
 
 ~CSCSkim () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

int chamberSerial (int kE, int kS, int kR, int kCh)
 
bool doBFieldStudySelection (edm::Handle< reco::TrackCollection > saTracks, edm::Handle< reco::TrackCollection > Tracks, edm::Handle< reco::MuonCollection > gMuons)
 
bool doCertainChamberSelection (edm::Handle< CSCWireDigiCollection > wires, edm::Handle< CSCStripDigiCollection > strips)
 
bool doCSCSkimming (edm::Handle< CSCRecHit2DCollection > cscRecHits, edm::Handle< CSCSegmentCollection > cscSegments)
 
bool doDTOverlap (edm::Handle< CSCSegmentCollection > cscSegments)
 
bool doHaloLike (edm::Handle< CSCSegmentCollection > cscSegments)
 
bool doLongSATrack (edm::Handle< reco::TrackCollection > saTracks)
 
bool doMessyEventSkimming (edm::Handle< CSCRecHit2DCollection > cscRecHits, edm::Handle< CSCSegmentCollection > cscSegments)
 
bool doOverlapSkimming (edm::Handle< CSCSegmentCollection > cscSegments)
 

Private Attributes

bool demandChambersBothSides
 
edm::EDGetTokenT< reco::MuonCollectionglm_token
 
std::string histogramFileName
 
TH1F * hxnHitChambers
 
TH1F * hxnRecHits
 
TH1F * hxnRecHitsSel
 
TH1F * hxnSegments
 
int iEvent
 
int iRun
 
bool isSimulation
 
bool makeHistograms
 
bool makeHistogramsForMessyEvents
 
TH1F * mevnChambers0
 
TH1F * mevnChambers1
 
TH1F * mevnRecHits0
 
TH1F * mevnRecHits1
 
TH1F * mevnSegments0
 
TH1F * mevnSegments1
 
int minimumHitChambers
 
int minimumSegments
 
int nCSCHitsMin
 
int nEventsAnalyzed
 
int nEventsCertainChamber
 
int nEventsChambersBothSides
 
int nEventsDTOverlap
 
int nEventsForBFieldStudies
 
int nEventsHaloLike
 
int nEventsLongSATrack
 
int nEventsMessy
 
int nEventsOverlappingChambers
 
int nEventsSelected
 
int nLayersWithHitsMinimum
 
int nTrHitsMin
 
int nValidHitsMin
 
std::string outputFileName
 
float pMin
 
float redChiSqMax
 
float rExtMax
 
edm::EDGetTokenT< CSCRecHit2DCollectionrh_token
 
edm::EDGetTokenT< reco::TrackCollectionsam_token
 
edm::EDGetTokenT< CSCStripDigiCollectionsdr_token
 
edm::EDGetTokenT< CSCStripDigiCollectionsds_token
 
edm::EDGetTokenT< CSCSegmentCollectionseg_token
 
TFile * theHistogramFile
 
edm::EDGetTokenT< reco::TrackCollectiontrk_token
 
int typeOfSkim
 
edm::EDGetTokenT< CSCWireDigiCollectionwdr_token
 
edm::EDGetTokenT< CSCWireDigiCollectionwds_token
 
int whichChamber
 
int whichEndcap
 
int whichRing
 
int whichStation
 
TH1F * xxnCSCHits
 
TH1F * xxnTrackerHits
 
TH1F * xxnValidHits
 
TH1F * xxP
 
TH1F * xxredChiSq
 
float zInnerMax
 
float zLengthMin
 
float zLengthTrMin
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

This simple program selects minimal CSC events for output.

Michael Schmitt, Northwestern University, July 2008

Description: Offline skim module for CSC cosmic ray data

Implementation: <Notes on="" implementation>="">

Definition at line 72 of file CSCSkim.h.

Constructor & Destructor Documentation

◆ CSCSkim()

CSCSkim::CSCSkim ( const edm::ParameterSet pset)
explicit

Definition at line 51 of file CSCSkim.cc.

51  {
52  // tokens from tags
53 
54  // Really should define the wire and digi tags in config, but for now, to avoid having to modify
55  // multiple config files, just hard-code those tags, to be equivalent to the pre-consumes code
56 
57  // wds_token = consumes<CSCWireDigiCollection>(pset.getParameter<InputTag>("simWireDigiTag"));
58  // sds_token = consumes<CSCStripDigiCollection>(pset.getParameter<InputTag>("simStripDigiTag"));
59  // wdr_token = consumes<CSCWireDigiCollection>(pset.getParameter<InputTag>("wireDigiTag"));
60  // sdr_token = consumes<CSCStripDigiCollection>(pset.getParameter<InputTag>("stripDigiTag"));
61 
62  wds_token = consumes<CSCWireDigiCollection>(edm::InputTag("simMuonCSCDigis", "MuonCSCWireDigi"));
63  sds_token = consumes<CSCStripDigiCollection>(edm::InputTag("simMuonCSCDigis", "MuonCSCStripDigi"));
64  wdr_token = consumes<CSCWireDigiCollection>(edm::InputTag("muonCSCDigis", "MuonCSCWireDigi"));
65  sdr_token = consumes<CSCStripDigiCollection>(edm::InputTag("muonCSCDigis", "MuonCSCStripDigi"));
66 
67  rh_token = consumes<CSCRecHit2DCollection>(pset.getParameter<InputTag>("cscRecHitTag"));
68  seg_token = consumes<CSCSegmentCollection>(pset.getParameter<InputTag>("cscSegmentTag"));
69 
70  sam_token = consumes<reco::TrackCollection>(pset.getParameter<InputTag>("SAMuonTag"));
71  trk_token = consumes<reco::TrackCollection>(pset.getParameter<InputTag>("trackTag"));
72  glm_token = consumes<reco::MuonCollection>(pset.getParameter<InputTag>("GLBMuonTag"));
73 
74  // Get the various input parameters
75  outputFileName = pset.getUntrackedParameter<std::string>("outputFileName", "outputSkim.root");
76  histogramFileName = pset.getUntrackedParameter<std::string>("histogramFileName", "histos.root");
77  typeOfSkim = pset.getUntrackedParameter<int>("typeOfSkim", 1);
78  nLayersWithHitsMinimum = pset.getUntrackedParameter<int>("nLayersWithHitsMinimum", 3);
79  minimumHitChambers = pset.getUntrackedParameter<int>("minimumHitChambers", 1);
80  minimumSegments = pset.getUntrackedParameter<int>("minimumSegments", 3);
81  demandChambersBothSides = pset.getUntrackedParameter<bool>("demandChambersBothSides", false);
82  makeHistograms = pset.getUntrackedParameter<bool>("makeHistograms", false);
83  makeHistogramsForMessyEvents = pset.getUntrackedParameter<bool>("makeHistogramsForMessyEvebts", false);
84  whichEndcap = pset.getUntrackedParameter<int>("whichEndcap", 2);
85  whichStation = pset.getUntrackedParameter<int>("whichStation", 3);
86  whichRing = pset.getUntrackedParameter<int>("whichRing", 2);
87  whichChamber = pset.getUntrackedParameter<int>("whichChamber", 24);
88 
89  // for BStudy selection (skim type 9)
90  pMin = pset.getUntrackedParameter<double>("pMin", 3.);
91  zLengthMin = pset.getUntrackedParameter<double>("zLengthMin", 200.);
92  nCSCHitsMin = pset.getUntrackedParameter<int>("nCSCHitsMin", 9);
93  zInnerMax = pset.getUntrackedParameter<double>("zInnerMax", 9000.);
94  nTrHitsMin = pset.getUntrackedParameter<int>("nTrHitsMin", 8);
95  zLengthTrMin = pset.getUntrackedParameter<double>("zLengthTrMin", 180.);
96  rExtMax = pset.getUntrackedParameter<double>("rExtMax", 3000.);
97  redChiSqMax = pset.getUntrackedParameter<double>("redChiSqMax", 20.);
98  nValidHitsMin = pset.getUntrackedParameter<int>("nValidHitsMin", 8);
99 
100  LogInfo("[CSCSkim] Setup") << "\n\t===== CSCSkim =====\n"
101  << "\t\ttype of skim ...............................\t" << typeOfSkim
102  << "\t\tminimum number of layers with hits .........\t" << nLayersWithHitsMinimum
103  << "\n\t\tminimum number of chambers w/ hit layers..\t" << minimumHitChambers
104  << "\n\t\tminimum number of segments ...............\t" << minimumSegments
105  << "\n\t\tdemand chambers on both sides.............\t" << demandChambersBothSides
106  << "\n\t\tmake histograms...........................\t" << makeHistograms
107  << "\n\t\t..for messy events........................\t" << makeHistogramsForMessyEvents
108  << "\n\t===================\n\n";
109 }

References CSCSkim_cfi::demandChambersBothSides, CSCSkim_cfi::histogramFileName, CSCSkim_cfi::makeHistograms, CommPDSkim_cfg::minimumHitChambers, CommPDSkim_cfg::minimumSegments, CSCSkim_cfi::nLayersWithHitsMinimum, reco_skim_cfg_mod::outputFileName, ALCARECOTkAlMinBias_cff::pMin, muonDTDigis_cfi::pset, AlCaHLTBitMon_QueryRunRegistry::string, CosmicsPD_Skims::typeOfSkim, CSCSkim_cfi::whichChamber, CSCSkim_cfi::whichEndcap, CSCSkim_cfi::whichRing, and CSCSkim_cfi::whichStation.

◆ ~CSCSkim()

CSCSkim::~CSCSkim ( )
override

Definition at line 114 of file CSCSkim.cc.

114 {}

Member Function Documentation

◆ beginJob()

void CSCSkim::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDFilter.

Definition at line 119 of file CSCSkim.cc.

119  {
120  // set counters to zero
121  nEventsAnalyzed = 0;
122  nEventsSelected = 0;
125  nEventsMessy = 0;
127  nEventsDTOverlap = 0;
128  nEventsHaloLike = 0;
129  nEventsLongSATrack = 0;
131  iRun = 0;
132  iEvent = 0;
133 
135  // Create the root file for the histograms
136  theHistogramFile = new TFile(histogramFileName.c_str(), "RECREATE");
137  theHistogramFile->cd();
138 
139  if (makeHistograms) {
140  // book histograms for the skimming module
141  hxnRecHits = new TH1F("hxnRecHits", "n RecHits", 61, -0.5, 60.5);
142  hxnSegments = new TH1F("hxnSegments", "n Segments", 11, -0.5, 10.5);
143  hxnHitChambers = new TH1F("hxnHitsChambers", "n chambers with hits", 11, -0.5, 10.5);
144  hxnRecHitsSel = new TH1F("hxnRecHitsSel", "n RecHits selected", 61, -0.5, 60.5);
145 
146  xxP = new TH1F("xxP", "P global", 100, 0., 200.);
147  xxnValidHits = new TH1F("xxnValidHits", "n valid hits global", 61, -0.5, 60.5);
148  xxnTrackerHits = new TH1F("xxnTrackerHits", "n tracker hits global", 61, -0.5, 60.5);
149  xxnCSCHits = new TH1F("xxnCSCHits", "n CSC hits global", 41, -0.5, 40.5);
150  xxredChiSq = new TH1F("xxredChiSq", "red chisq global", 100, 0., 100.);
151  }
153  // book histograms for the messy event skimming module
154  mevnRecHits0 = new TH1F("mevnRecHits0", "n RecHits", 121, -0.5, 120.5);
155  mevnChambers0 = new TH1F("mevnChambers0", "n chambers with hits", 21, -0.5, 20.5);
156  mevnSegments0 = new TH1F("mevnSegments0", "n Segments", 21, -0.5, 20.5);
157  mevnRecHits1 = new TH1F("mevnRecHits1", "n RecHits", 100, 0., 300.);
158  mevnChambers1 = new TH1F("mevnChambers1", "n chambers with hits", 50, 0., 50.);
159  mevnSegments1 = new TH1F("mevnSegments1", "n Segments", 30, 0., 30.);
160  }
161  }
162 }

References CSCSkim_cfi::histogramFileName, iEvent, and CSCSkim_cfi::makeHistograms.

◆ chamberSerial()

int CSCSkim::chamberSerial ( int  kE,
int  kS,
int  kR,
int  kCh 
)
private

Definition at line 1294 of file CSCSkim.cc.

1294  {
1295  int kSerial = kChamber;
1296  if (kStation == 1 && kRing == 1) {
1297  kSerial = kChamber;
1298  }
1299  if (kStation == 1 && kRing == 2) {
1300  kSerial = kChamber + 36;
1301  }
1302  if (kStation == 1 && kRing == 3) {
1303  kSerial = kChamber + 72;
1304  }
1305  if (kStation == 1 && kRing == 4) {
1306  kSerial = kChamber;
1307  }
1308  if (kStation == 2 && kRing == 1) {
1309  kSerial = kChamber + 108;
1310  }
1311  if (kStation == 2 && kRing == 2) {
1312  kSerial = kChamber + 126;
1313  }
1314  if (kStation == 3 && kRing == 1) {
1315  kSerial = kChamber + 162;
1316  }
1317  if (kStation == 3 && kRing == 2) {
1318  kSerial = kChamber + 180;
1319  }
1320  if (kStation == 4 && kRing == 1) {
1321  kSerial = kChamber + 216;
1322  }
1323  if (kStation == 4 && kRing == 2) {
1324  kSerial = kChamber + 234;
1325  } // one day...
1326  if (kEndcap == 2) {
1327  kSerial = kSerial + 300;
1328  }
1329  return kSerial;
1330 }

◆ doBFieldStudySelection()

bool CSCSkim::doBFieldStudySelection ( edm::Handle< reco::TrackCollection saTracks,
edm::Handle< reco::TrackCollection Tracks,
edm::Handle< reco::MuonCollection gMuons 
)
private

Definition at line 1110 of file CSCSkim.cc.

1112  {
1113  bool acceptThisEvent = false;
1114 
1115  //-----------------------------------
1116  // examine the stand-alone tracks
1117  //-----------------------------------
1118  int nGoodSAMuons = 0;
1119  for (reco::TrackCollection::const_iterator muon = saMuons->begin(); muon != saMuons->end(); ++muon) {
1120  float preco = muon->p();
1121 
1122  math::XYZPoint innerPo = muon->innerPosition();
1123  GlobalPoint iPnt(innerPo.x(), innerPo.y(), innerPo.z());
1124  math::XYZPoint outerPo = muon->outerPosition();
1125  GlobalPoint oPnt(outerPo.x(), outerPo.y(), outerPo.z());
1126  float zLength = abs(iPnt.z() - oPnt.z());
1127 
1128  math::XYZVector innerMom = muon->innerMomentum();
1129  GlobalVector iP(innerMom.x(), innerMom.y(), innerMom.z());
1130  math::XYZVector outerMom = muon->outerMomentum();
1131  GlobalVector oP(outerMom.x(), outerMom.y(), outerMom.z());
1132 
1133  const float zRef = 300.;
1134  float xExt = 10000.;
1135  float yExt = 10000.;
1136  if (abs(oPnt.z()) < abs(iPnt.z())) {
1137  float deltaZ = 0.;
1138  if (oPnt.z() > 0) {
1139  deltaZ = zRef - oPnt.z();
1140  } else {
1141  deltaZ = -zRef - oPnt.z();
1142  }
1143  xExt = oPnt.x() + deltaZ * oP.x() / oP.z();
1144  yExt = oPnt.y() + deltaZ * oP.y() / oP.z();
1145  } else {
1146  float deltaZ = 0.;
1147  if (iPnt.z() > 0) {
1148  deltaZ = zRef - iPnt.z();
1149  } else {
1150  deltaZ = -zRef - iPnt.z();
1151  }
1152  xExt = iPnt.x() + deltaZ * iP.x() / iP.z();
1153  yExt = iPnt.y() + deltaZ * iP.y() / iP.z();
1154  }
1155  float rExt = sqrt(xExt * xExt + yExt * yExt);
1156 
1157  int kHit = 0;
1158  int nDTHits = 0;
1159  int nCSCHits = 0;
1160  for (trackingRecHit_iterator hit = muon->recHitsBegin(); hit != muon->recHitsEnd(); ++hit) {
1161  ++kHit;
1162  const DetId detId((*hit)->geographicalId());
1163  if (detId.det() == DetId::Muon) {
1164  if (detId.subdetId() == MuonSubdetId::DT) {
1165  nDTHits++;
1166  } else if (detId.subdetId() == MuonSubdetId::CSC) {
1167  nCSCHits++;
1168  }
1169  }
1170  } // end loop over hits
1171 
1172  float zInner = -1.;
1173  if (nCSCHits >= nCSCHitsMin) {
1174  if (abs(iPnt.z()) < abs(iPnt.z())) {
1175  zInner = iPnt.z();
1176  } else {
1177  zInner = oPnt.z();
1178  }
1179  }
1180 
1181  bool goodSAMuon = (preco > pMin) && (zLength > zLengthMin) && (nCSCHits >= nCSCHitsMin) && (zInner < zInnerMax) &&
1182  (rExt < rExtMax);
1183 
1184  if (goodSAMuon) {
1185  nGoodSAMuons++;
1186  }
1187 
1188  } // end loop over stand-alone muon collection
1189 
1190  //-----------------------------------
1191  // examine the tracker tracks
1192  //-----------------------------------
1193  int nGoodTracks = 0;
1194  for (reco::TrackCollection::const_iterator track = tracks->begin(); track != tracks->end(); ++track) {
1195  float preco = track->p();
1196  int n = track->recHitsSize();
1197 
1198  math::XYZPoint innerPo = track->innerPosition();
1199  GlobalPoint iPnt(innerPo.x(), innerPo.y(), innerPo.z());
1200  math::XYZPoint outerPo = track->outerPosition();
1201  GlobalPoint oPnt(outerPo.x(), outerPo.y(), outerPo.z());
1202  float zLength = abs(iPnt.z() - oPnt.z());
1203 
1204  math::XYZVector innerMom = track->innerMomentum();
1205  GlobalVector iP(innerMom.x(), innerMom.y(), innerMom.z());
1206  math::XYZVector outerMom = track->outerMomentum();
1207  GlobalVector oP(outerMom.x(), outerMom.y(), outerMom.z());
1208 
1209  const float zRef = 300.;
1210  float xExt = 10000.;
1211  float yExt = 10000.;
1212  if (abs(oPnt.z()) > abs(iPnt.z())) {
1213  float deltaZ = 0.;
1214  if (oPnt.z() > 0) {
1215  deltaZ = zRef - oPnt.z();
1216  } else {
1217  deltaZ = -zRef - oPnt.z();
1218  }
1219  xExt = oPnt.x() + deltaZ * oP.x() / oP.z();
1220  yExt = oPnt.y() + deltaZ * oP.y() / oP.z();
1221  } else {
1222  float deltaZ = 0.;
1223  if (iPnt.z() > 0) {
1224  deltaZ = zRef - iPnt.z();
1225  } else {
1226  deltaZ = -zRef - iPnt.z();
1227  }
1228  xExt = iPnt.x() + deltaZ * iP.x() / iP.z();
1229  yExt = iPnt.y() + deltaZ * iP.y() / iP.z();
1230  }
1231  float rExt = sqrt(xExt * xExt + yExt * yExt);
1232 
1233  bool goodTrack = (preco > pMin) && (n >= nTrHitsMin) && (zLength > zLengthTrMin) && (rExt < rExtMax);
1234 
1235  if (goodTrack) {
1236  nGoodTracks++;
1237  }
1238 
1239  } // end loop over tracker tracks
1240 
1241  //-----------------------------------
1242  // examine the global muons
1243  //-----------------------------------
1244  int nGoodGlobalMuons = 0;
1245  for (reco::MuonCollection::const_iterator global = gMuons->begin(); global != gMuons->end(); ++global) {
1246  if (global->isGlobalMuon()) {
1247  float pDef = global->p();
1248  float redChiSq = global->globalTrack()->normalizedChi2();
1249  const reco::HitPattern& hp = (global->globalTrack())->hitPattern();
1250  // int nTotalHits = hp.numberOfHits();
1251  // int nValidHits = hp.numberOfValidHits();
1252  int nTrackerHits = hp.numberOfValidTrackerHits();
1253  // int nPixelHits = hp.numberOfValidPixelHits();
1254  // int nStripHits = hp.numberOfValidStripHits();
1255 
1256  int nDTHits = 0;
1257  int nCSCHits = 0;
1258  for (trackingRecHit_iterator hit = (global->globalTrack())->recHitsBegin();
1259  hit != (global->globalTrack())->recHitsEnd();
1260  ++hit) {
1261  const DetId detId((*hit)->geographicalId());
1262  if (detId.det() == DetId::Muon) {
1263  if (detId.subdetId() == MuonSubdetId::DT) {
1264  nDTHits++;
1265  } else if (detId.subdetId() == MuonSubdetId::CSC) {
1266  nCSCHits++;
1267  }
1268  }
1269  } // end loop over hits
1270 
1271  bool goodGlobalMuon =
1272  (pDef > pMin) && (nTrackerHits >= nValidHitsMin) && (nCSCHits >= nCSCHitsMin) && (redChiSq < redChiSqMax);
1273 
1274  if (goodGlobalMuon) {
1275  nGoodGlobalMuons++;
1276  }
1277 
1278  } // this is a global muon
1279  } // end loop over stand-alone muon collection
1280 
1281  //-----------------------------------
1282  // do we accept this event?
1283  //-----------------------------------
1284 
1285  acceptThisEvent = ((nGoodSAMuons > 0) && (nGoodTracks > 0)) || (nGoodGlobalMuons > 0);
1286 
1287  return acceptThisEvent;
1288 }

References funct::abs(), MuonSubdetId::CSC, MuonSubdetId::DT, spr::goodTrack(), trackingPlots::hp, DetId::Muon, HLT_2018_cff::muon, dqmiodumpmetadata::n, ALCARECOTkAlMinBias_cff::pMin, mathSSE::sqrt(), HLT_2018_cff::track, PDWG_EXOHSCP_cff::tracks, and PV3DBase< T, PVType, FrameType >::z().

◆ doCertainChamberSelection()

bool CSCSkim::doCertainChamberSelection ( edm::Handle< CSCWireDigiCollection wires,
edm::Handle< CSCStripDigiCollection strips 
)
private

Definition at line 729 of file CSCSkim.cc.

730  {
731  // Loop through the wire DIGIs, looking for a match
732  bool certainChamberIsPresentInWires = false;
733  for (CSCWireDigiCollection::DigiRangeIterator jw = wires->begin(); jw != wires->end(); jw++) {
734  CSCDetId id = (CSCDetId)(*jw).first;
735  int kEndcap = id.endcap();
736  int kRing = id.ring();
737  int kStation = id.station();
738  int kChamber = id.chamber();
739  if ((kEndcap == whichEndcap) && (kStation == whichStation) && (kRing == whichRing) && (kChamber == whichChamber)) {
740  certainChamberIsPresentInWires = true;
741  }
742  } // end wire loop
743 
744  // Loop through the strip DIGIs, looking for a match
745  bool certainChamberIsPresentInStrips = false;
746  for (CSCStripDigiCollection::DigiRangeIterator js = strips->begin(); js != strips->end(); js++) {
747  CSCDetId id = (CSCDetId)(*js).first;
748  int kEndcap = id.endcap();
749  int kRing = id.ring();
750  int kStation = id.station();
751  int kChamber = id.chamber();
752  if ((kEndcap == whichEndcap) && (kStation == whichStation) && (kRing == whichRing) && (kChamber == whichChamber)) {
753  certainChamberIsPresentInStrips = true;
754  }
755  }
756 
757  bool certainChamberIsPresent = certainChamberIsPresentInWires || certainChamberIsPresentInStrips;
758 
759  return certainChamberIsPresent;
760 }

References CSCDetId::endcap(), DigiDM_cff::strips, CSCSkim_cfi::whichChamber, CSCSkim_cfi::whichEndcap, CSCSkim_cfi::whichRing, CSCSkim_cfi::whichStation, and DigiDM_cff::wires.

◆ doCSCSkimming()

bool CSCSkim::doCSCSkimming ( edm::Handle< CSCRecHit2DCollection cscRecHits,
edm::Handle< CSCSegmentCollection cscSegments 
)
private

Definition at line 376 of file CSCSkim.cc.

377  {
378  // how many RecHits in the collection?
379  int nRecHits = cscRecHits->size();
380 
381  // zero the recHit counter
382  int cntRecHit[600];
383  for (int i = 0; i < 600; i++) {
384  cntRecHit[i] = 0;
385  }
386 
387  // ---------------------
388  // Loop over rechits
389  // ---------------------
390 
392  for (recIt = cscRecHits->begin(); recIt != cscRecHits->end(); recIt++) {
393  // which chamber is it?
394  CSCDetId idrec = (CSCDetId)(*recIt).cscDetId();
395  int kEndcap = idrec.endcap();
396  int kRing = idrec.ring();
397  int kStation = idrec.station();
398  int kChamber = idrec.chamber();
399  int kLayer = idrec.layer();
400 
401  // compute chamber serial number
402  int kSerial = chamberSerial(kEndcap, kStation, kRing, kChamber);
403 
404  // increment recHit counter
405  // (each layer is represented by a different power of 10)
406  int kDigit = (int)pow((float)10., (float)(kLayer - 1));
407  cntRecHit[kSerial] += kDigit;
408 
409  } //end rechit loop
410 
411  // ------------------------------------------------------
412  // Are there chambers with the minimum number of hits?
413  // ------------------------------------------------------
414 
415  int nChambersWithMinimalHits = 0;
416  int nChambersWithMinimalHitsPOS = 0;
417  int nChambersWithMinimalHitsNEG = 0;
418  if (nRecHits > 0) {
419  for (int i = 0; i < 600; i++) {
420  if (cntRecHit[i] > 0) {
421  int nLayersWithHits = 0;
422  float dummy = (float)cntRecHit[i];
423  for (int j = 5; j > -1; j--) {
424  float digit = dummy / pow((float)10., (float)j);
425  int kCount = (int)digit;
426  if (kCount > 0)
427  nLayersWithHits++;
428  dummy = dummy - ((float)kCount) * pow((float)10., (float)j);
429  }
430  if (nLayersWithHits > nLayersWithHitsMinimum) {
431  if (i < 300) {
432  nChambersWithMinimalHitsPOS++;
433  } else {
434  nChambersWithMinimalHitsNEG++;
435  }
436  }
437  }
438  }
439  nChambersWithMinimalHits = nChambersWithMinimalHitsPOS + nChambersWithMinimalHitsNEG;
440  }
441 
442  // how many Segments?
443  int nSegments = cscSegments->size();
444 
445  // ----------------------
446  // fill histograms
447  // ----------------------
448 
449  if (makeHistograms) {
450  hxnRecHits->Fill(nRecHits);
451  if (nRecHits > 0) {
452  hxnSegments->Fill(nSegments);
453  hxnHitChambers->Fill(nChambersWithMinimalHits);
454  }
455  if (nChambersWithMinimalHits > 0) {
456  hxnRecHitsSel->Fill(nRecHits);
457  }
458  }
459 
460  // ----------------------
461  // set the filter flag
462  // ----------------------
463  bool basicEvent = (nChambersWithMinimalHits >= minimumHitChambers) && (nSegments >= minimumSegments);
464 
465  bool chambersOnBothSides =
466  ((nChambersWithMinimalHitsPOS >= minimumHitChambers) && (nChambersWithMinimalHitsNEG >= minimumHitChambers));
467 
468  if (chambersOnBothSides) {
470  }
471 
472  bool selectEvent = false;
473  if (typeOfSkim == 1) {
474  selectEvent = basicEvent;
475  }
476  if (typeOfSkim == 2) {
477  selectEvent = chambersOnBothSides;
478  }
479 
480  // debug
481  LogDebug("[CSCSkim]") << "----- nRecHits = " << nRecHits
482  << "\tnChambersWithMinimalHits = " << nChambersWithMinimalHits << "\tnSegments = " << nSegments
483  << "\tselect? " << selectEvent << std::endl;
484 
485  /*
486  if ((nChambersWithMinimalHitsPOS >= minimumHitChambers) && (nChambersWithMinimalHitsNEG >= minimumHitChambers)) {
487  std::cout << "\n==========================================================================\n"
488  << "\tinteresting event - chambers hit on both sides\n"
489  << "\t " << nEventsAnalyzed
490  << "\trun " << iRun << "\tevent " << iEvent << std::endl;
491  std::cout << "----- nRecHits = " << nRecHits
492  << "\tnChambersWithMinimalHits = " << nChambersWithMinimalHits
493  << "\tnSegments = " << nSegments
494  << "\tselect? " << selectEvent << std::endl;
495  for (int i = 0; i < 600; i++) {
496  if (cntRecHit[i] > 0) {
497  cout << "\t\t" << i << "\tcntRecHit= " << cntRecHit[i] << std::endl;
498  }
499  }
500  std::cout << "==========================================================================\n\n" ;
501  }
502  */
503 
504  return selectEvent;
505 }

References CSCDetId::chamber(), dtChamberEfficiency_cfi::cscSegments, CSCDetId::endcap(), dqmMemoryStats::float, mps_fire::i, createfilelist::int, dqmiolumiharvest::j, kLayer(), CSCDetId::layer(), LogDebug, CSCSkim_cfi::makeHistograms, CommPDSkim_cfg::minimumHitChambers, CommPDSkim_cfg::minimumSegments, CSCSkim_cfi::nLayersWithHitsMinimum, funct::pow(), CSCDetId::ring(), CSCDetId::station(), and CosmicsPD_Skims::typeOfSkim.

◆ doDTOverlap()

bool CSCSkim::doDTOverlap ( edm::Handle< CSCSegmentCollection cscSegments)
private

Definition at line 767 of file CSCSkim.cc.

767  {
768  const float chisqMax = 100.;
769  const int nhitsMin = 5;
770  const int maxNSegments = 3;
771 
772  // initialize
773  bool DTOverlapCandidate = false;
774  int cntMEP13[36];
775  int cntMEN13[36];
776  int cntMEP22[36];
777  int cntMEN22[36];
778  int cntMEP32[36];
779  int cntMEN32[36];
780  for (int i = 0; i < 36; ++i) {
781  cntMEP13[i] = 0;
782  cntMEN13[i] = 0;
783  cntMEP22[i] = 0;
784  cntMEN22[i] = 0;
785  cntMEP32[i] = 0;
786  cntMEN32[i] = 0;
787  }
788 
789  // -----------------------
790  // loop over segments
791  // -----------------------
792 
793  int nSegments = cscSegments->size();
794  if (nSegments < 2)
795  return DTOverlapCandidate;
796 
797  for (CSCSegmentCollection::const_iterator it = cscSegments->begin(); it != cscSegments->end(); it++) {
798  // which chamber?
799  CSCDetId id = (CSCDetId)(*it).cscDetId();
800  int kEndcap = id.endcap();
801  int kStation = id.station();
802  int kRing = id.ring();
803  int kChamber = id.chamber();
804  // segment information
805  float chisq = (*it).chi2();
806  int nhits = (*it).nRecHits();
807  bool goodSegment = (chisq < chisqMax) && (nhits >= nhitsMin);
808  if (goodSegment) {
809  if ((kStation == 1) && (kRing == 3)) {
810  if (kEndcap == 1) {
811  cntMEP13[kChamber - 1]++;
812  }
813  if (kEndcap == 2) {
814  cntMEN13[kChamber - 1]++;
815  }
816  }
817  if ((kStation == 2) && (kRing == 2)) {
818  if (kEndcap == 1) {
819  cntMEP22[kChamber - 1]++;
820  }
821  if (kEndcap == 2) {
822  cntMEN22[kChamber - 1]++;
823  }
824  }
825  if ((kStation == 3) && (kRing == 2)) {
826  if (kEndcap == 1) {
827  cntMEP32[kChamber - 1]++;
828  }
829  if (kEndcap == 2) {
830  cntMEN32[kChamber - 1]++;
831  }
832  }
833  } // this is a good segment
834  } // end loop over segments
835 
836  // ---------------------------------------------
837  // veto messy events
838  // ---------------------------------------------
839  bool tooManySegments = false;
840  for (int i = 0; i < 36; ++i) {
841  if ((cntMEP13[i] > maxNSegments) || (cntMEN13[i] > maxNSegments) || (cntMEP22[i] > maxNSegments) ||
842  (cntMEN22[i] > maxNSegments) || (cntMEP32[i] > maxNSegments) || (cntMEN32[i] > maxNSegments))
843  tooManySegments = true;
844  }
845  if (tooManySegments) {
846  return DTOverlapCandidate;
847  }
848 
849  // ---------------------------------------------
850  // check for relevant matchup of segments
851  // ---------------------------------------------
852  bool matchup = false;
853  for (int i = 0; i < 36; ++i) {
854  if ((cntMEP13[i] > 0) && (cntMEP22[i] + cntMEP32[i] > 0)) {
855  matchup = true;
856  }
857  if ((cntMEN13[i] > 0) && (cntMEN22[i] + cntMEN32[i] > 0)) {
858  matchup = true;
859  }
860  }
861  /*
862  if (matchup) {
863  std::cout << "\tYYY looks like a good event. Select!\n";
864  std::cout << "-- pos endcap --\n"
865  << "ME1/3: ";
866  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEP13[k];}
867  std::cout << "\nME2/2: ";
868  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEP22[k];}
869  std::cout << "\nME3/2: ";
870  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEP32[k];}
871  std::cout << std::endl;
872  }
873  */
874 
875  // set the selection flag
876  DTOverlapCandidate = matchup;
877  return DTOverlapCandidate;
878 }

References dtChamberEfficiency_cfi::cscSegments, CSCDetId::endcap(), mps_fire::i, and nhits.

◆ doHaloLike()

bool CSCSkim::doHaloLike ( edm::Handle< CSCSegmentCollection cscSegments)
private

Definition at line 886 of file CSCSkim.cc.

886  {
887  const float chisqMax = 100.;
888  const int nhitsMin = 5; // on a segment
889  const int maxNSegments = 3; // in a chamber
890 
891  // initialize
892  bool HaloLike = false;
893  int cntMEP11[36];
894  int cntMEN11[36];
895  int cntMEP12[36];
896  int cntMEN12[36];
897  int cntMEP21[36];
898  int cntMEN21[36];
899  int cntMEP31[36];
900  int cntMEN31[36];
901  int cntMEP41[36];
902  int cntMEN41[36];
903  for (int i = 0; i < 36; ++i) {
904  cntMEP11[i] = 0;
905  cntMEN11[i] = 0;
906  cntMEP12[i] = 0;
907  cntMEN12[i] = 0;
908  cntMEP21[i] = 0;
909  cntMEN21[i] = 0;
910  cntMEP31[i] = 0;
911  cntMEN31[i] = 0;
912  cntMEP41[i] = 0;
913  cntMEN41[i] = 0;
914  }
915 
916  // -----------------------
917  // loop over segments
918  // -----------------------
919  int nSegments = cscSegments->size();
920  if (nSegments < 4)
921  return HaloLike;
922 
923  for (CSCSegmentCollection::const_iterator it = cscSegments->begin(); it != cscSegments->end(); it++) {
924  // which chamber?
925  CSCDetId id = (CSCDetId)(*it).cscDetId();
926  int kEndcap = id.endcap();
927  int kStation = id.station();
928  int kRing = id.ring();
929  int kChamber = id.chamber();
930  // segment information
931  float chisq = (*it).chi2();
932  int nhits = (*it).nRecHits();
933  bool goodSegment = (chisq < chisqMax) && (nhits >= nhitsMin);
934  if (goodSegment) {
935  if ((kStation == 1) && (kRing == 1)) {
936  if (kEndcap == 1) {
937  cntMEP11[kChamber - 1]++;
938  }
939  if (kEndcap == 2) {
940  cntMEN11[kChamber - 1]++;
941  }
942  }
943  if ((kStation == 1) && (kRing == 2)) {
944  if (kEndcap == 1) {
945  cntMEP12[kChamber - 1]++;
946  }
947  if (kEndcap == 2) {
948  cntMEN12[kChamber - 1]++;
949  }
950  }
951  if ((kStation == 2) && (kRing == 1)) {
952  if (kEndcap == 1) {
953  cntMEP21[kChamber - 1]++;
954  }
955  if (kEndcap == 2) {
956  cntMEN21[kChamber - 1]++;
957  }
958  }
959  if ((kStation == 3) && (kRing == 1)) {
960  if (kEndcap == 1) {
961  cntMEP31[kChamber - 1]++;
962  }
963  if (kEndcap == 2) {
964  cntMEN31[kChamber - 1]++;
965  }
966  }
967  if ((kStation == 4) && (kRing == 1)) {
968  if (kEndcap == 1) {
969  cntMEP41[kChamber - 1]++;
970  }
971  if (kEndcap == 2) {
972  cntMEN41[kChamber - 1]++;
973  }
974  }
975  } // this is a good segment
976  } // end loop over segments
977 
978  // ---------------------------------------------
979  // veto messy events
980  // ---------------------------------------------
981  bool tooManySegments = false;
982  for (int i = 0; i < 36; ++i) {
983  if ((cntMEP11[i] > 3 * maxNSegments) || (cntMEN11[i] > 3 * maxNSegments) || (cntMEP12[i] > maxNSegments) ||
984  (cntMEN12[i] > maxNSegments) || (cntMEP21[i] > maxNSegments) || (cntMEN21[i] > maxNSegments) ||
985  (cntMEP31[i] > maxNSegments) || (cntMEN31[i] > maxNSegments) || (cntMEP41[i] > maxNSegments) ||
986  (cntMEN41[i] > maxNSegments))
987  tooManySegments = true;
988  }
989  if (tooManySegments) {
990  return HaloLike;
991  }
992 
993  // ---------------------------------------------
994  // check for relevant matchup of segments
995  // ---------------------------------------------
996  bool matchup = false;
997  for (int i = 0; i < 36; ++i) {
998  if ((cntMEP11[i] + cntMEP12[i] > 0) && (cntMEP21[i] > 0) && (cntMEP31[i] > 0) && (cntMEP41[i] > 0)) {
999  matchup = true;
1000  }
1001  if ((cntMEN11[i] + cntMEN12[i] > 0) && (cntMEN21[i] > 0) && (cntMEN31[i] > 0) && (cntMEN41[i] > 0)) {
1002  matchup = true;
1003  }
1004  }
1005  /*
1006  if (matchup) {
1007  std::cout << "\tYYY looks like a good event. Select!\n";
1008  std::cout << "-- pos endcap --\n"
1009  << "ME1/1: ";
1010  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEP11[k];}
1011  std::cout << "\nME1/2: ";
1012  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEP12[k];}
1013  std::cout << "\nME2/1: ";
1014  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEP21[k];}
1015  std::cout << "\nME3/1: ";
1016  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEP31[k];}
1017  std::cout << "\nME4/1: ";
1018  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEP41[k];}
1019  std::cout << std::endl;
1020  std::cout << "-- neg endcap --\n"
1021  << "ME1/1: ";
1022  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEN11[k];}
1023  std::cout << "\nME1/2: ";
1024  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEN12[k];}
1025  std::cout << "\nME2/1: ";
1026  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEN21[k];}
1027  std::cout << "\nME3/1: ";
1028  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEN31[k];}
1029  std::cout << "\nME4/1: ";
1030  for (int k=0; k<36; ++k) {std::cout << " " << setw(3) << cntMEN41[k];}
1031  std::cout << std::endl;
1032  std::cout << "\tn Analyzed = " << nEventsAnalyzed << "\tn Halo-like = " << nEventsHaloLike << std::endl;
1033  }
1034  */
1035 
1036  // set the selection flag
1037  HaloLike = matchup;
1038  return HaloLike;
1039 }

References dtChamberEfficiency_cfi::cscSegments, CSCDetId::endcap(), mps_fire::i, and nhits.

◆ doLongSATrack()

bool CSCSkim::doLongSATrack ( edm::Handle< reco::TrackCollection saTracks)
private

Definition at line 1044 of file CSCSkim.cc.

1044  {
1045  const float zDistanceMax = 2500.;
1046  const float zDistanceMin = 700.;
1047  const int nCSCHitsMin = 25;
1048  const int nCSCHitsMax = 50;
1049  const float zInnerMax = 80000.;
1050 
1051  const int nNiceMuonsMin = 1;
1052 
1053  //
1054  // Loop through the track collection and test each one
1055  //
1056 
1057  int nNiceMuons = 0;
1058 
1059  for (reco::TrackCollection::const_iterator muon = saMuons->begin(); muon != saMuons->end(); ++muon) {
1060  // basic information
1061  math::XYZVector innerMo = muon->innerMomentum();
1062  GlobalVector im(innerMo.x(), innerMo.y(), innerMo.z());
1063  math::XYZPoint innerPo = muon->innerPosition();
1064  GlobalPoint ip(innerPo.x(), innerPo.y(), innerPo.z());
1065  math::XYZPoint outerPo = muon->outerPosition();
1066  GlobalPoint op(outerPo.x(), outerPo.y(), outerPo.z());
1067  float zInner = ip.z();
1068  float zOuter = op.z();
1069  float zDistance = fabs(zOuter - zInner);
1070 
1071  // loop over hits
1072  int nDTHits = 0;
1073  int nCSCHits = 0;
1074  for (trackingRecHit_iterator hit = muon->recHitsBegin(); hit != muon->recHitsEnd(); ++hit) {
1075  const DetId detId((*hit)->geographicalId());
1076  if (detId.det() == DetId::Muon) {
1077  if (detId.subdetId() == MuonSubdetId::DT) {
1078  //DTChamberId dtId(detId.rawId());
1079  //int chamberId = dtId.sector();
1080  nDTHits++;
1081  } else if (detId.subdetId() == MuonSubdetId::CSC) {
1082  //CSCDetId cscId(detId.rawId());
1083  //int chamberId = cscId.chamber();
1084  nCSCHits++;
1085  }
1086  }
1087  }
1088 
1089  // is this a nice muon?
1090  if ((zDistance < zDistanceMax) && (zDistance > zDistanceMin) && (nCSCHits > nCSCHitsMin) &&
1091  (nCSCHits < nCSCHitsMax) && (min(fabs(zInner), fabs(zOuter)) < zInnerMax) &&
1092  (fabs(innerMo.z()) > 0.000000001)) {
1093  nNiceMuons++;
1094  }
1095  }
1096 
1097  bool select = (nNiceMuons >= nNiceMuonsMin);
1098 
1099  return select;
1100 }

References MuonSubdetId::CSC, MuonSubdetId::DT, min(), DetId::Muon, HLT_2018_cff::muon, singleTopDQM_cfi::select, and PV3DBase< T, PVType, FrameType >::z().

◆ doMessyEventSkimming()

bool CSCSkim::doMessyEventSkimming ( edm::Handle< CSCRecHit2DCollection cscRecHits,
edm::Handle< CSCSegmentCollection cscSegments 
)
private

Definition at line 593 of file CSCSkim.cc.

594  {
595  // how many RecHits in the collection?
596  int nRecHits = cscRecHits->size();
597 
598  // zero the recHit counter
599  int cntRecHit[600];
600  for (int i = 0; i < 600; i++) {
601  cntRecHit[i] = 0;
602  }
603 
604  // ---------------------
605  // Loop over rechits
606  // ---------------------
607 
609  for (recIt = cscRecHits->begin(); recIt != cscRecHits->end(); recIt++) {
610  // which chamber is it?
611  CSCDetId idrec = (CSCDetId)(*recIt).cscDetId();
612  int kEndcap = idrec.endcap();
613  int kRing = idrec.ring();
614  int kStation = idrec.station();
615  int kChamber = idrec.chamber();
616  int kLayer = idrec.layer();
617 
618  // compute chamber serial number
619  int kSerial = chamberSerial(kEndcap, kStation, kRing, kChamber);
620 
621  // increment recHit counter
622  // (each layer is represented by a different power of 10)
623  int kDigit = (int)pow((float)10., (float)(kLayer - 1));
624  cntRecHit[kSerial] += kDigit;
625 
626  } //end rechit loop
627 
628  // ------------------------------------------------------
629  // Are there chambers with the minimum number of hits?
630  // ------------------------------------------------------
631 
632  int nChambersWithMinimalHits = 0;
633  int nChambersWithMinimalHitsPOS = 0;
634  int nChambersWithMinimalHitsNEG = 0;
635  if (nRecHits > 0) {
636  for (int i = 0; i < 600; i++) {
637  if (cntRecHit[i] > 0) {
638  int nLayersWithHits = 0;
639  float dummy = (float)cntRecHit[i];
640  for (int j = 5; j > -1; j--) {
641  float digit = dummy / pow((float)10., (float)j);
642  int kCount = (int)digit;
643  if (kCount > 0)
644  nLayersWithHits++;
645  dummy = dummy - ((float)kCount) * pow((float)10., (float)j);
646  }
647  if (nLayersWithHits > nLayersWithHitsMinimum) {
648  if (i < 300) {
649  nChambersWithMinimalHitsPOS++;
650  } else {
651  nChambersWithMinimalHitsNEG++;
652  }
653  }
654  }
655  }
656  nChambersWithMinimalHits = nChambersWithMinimalHitsPOS + nChambersWithMinimalHitsNEG;
657  }
658 
659  // how many Segments?
660  int nSegments = cscSegments->size();
661 
662  // ----------------------
663  // fill histograms
664  // ----------------------
665 
667  if (nRecHits > 8) {
668  mevnRecHits0->Fill(nRecHits);
669  mevnChambers0->Fill(nChambersWithMinimalHits);
670  mevnSegments0->Fill(nSegments);
671  }
672  if (nRecHits > 54) {
673  double dummy = (double)nRecHits;
674  if (dummy > 299.9)
675  dummy = 299.9;
676  mevnRecHits1->Fill(dummy);
677  dummy = (double)nChambersWithMinimalHits;
678  if (dummy > 49.9)
679  dummy = 49.9;
680  mevnChambers1->Fill(dummy);
681  dummy = (double)nSegments;
682  if (dummy > 29.9)
683  dummy = 29.9;
684  mevnSegments1->Fill(dummy);
685  }
686  }
687 
688  // ----------------------
689  // set the filter flag
690  // ----------------------
691 
692  bool selectEvent = false;
693  if ((nRecHits > 54) && (nChambersWithMinimalHits > 5)) {
694  selectEvent = true;
695  }
696 
697  // debug
698  LogDebug("[CSCSkim]") << "----- nRecHits = " << nRecHits
699  << "\tnChambersWithMinimalHits = " << nChambersWithMinimalHits << "\tnSegments = " << nSegments
700  << "\tselect? " << selectEvent << std::endl;
701 
702  /*
703  if (selectEvent) {
704  std::cout << "\n==========================================================================\n"
705  << "\tmessy event!\n"
706  << "\t " << nEventsAnalyzed
707  << "\trun " << iRun << "\tevent " << iEvent << std::endl;
708  std::cout << "----- nRecHits = " << nRecHits
709  << "\tnChambersWithMinimalHits = " << nChambersWithMinimalHits
710  << "\tnSegments = " << nSegments
711  << "\tselect? " << selectEvent << std::endl;
712  for (int i = 0; i < 600; i++) {
713  if (cntRecHit[i] > 0) {
714  cout << "\t\t" << i << "\tcntRecHit= " << cntRecHit[i] << std::endl;
715  }
716  }
717  std::cout << "==========================================================================\n\n" ;
718  }
719  */
720 
721  return selectEvent;
722 }

References CSCDetId::chamber(), dtChamberEfficiency_cfi::cscSegments, CSCDetId::endcap(), dqmMemoryStats::float, mps_fire::i, createfilelist::int, dqmiolumiharvest::j, kLayer(), CSCDetId::layer(), LogDebug, CSCSkim_cfi::nLayersWithHitsMinimum, funct::pow(), CSCDetId::ring(), and CSCDetId::station().

◆ doOverlapSkimming()

bool CSCSkim::doOverlapSkimming ( edm::Handle< CSCSegmentCollection cscSegments)
private

Definition at line 511 of file CSCSkim.cc.

511  {
512  const int nhitsMinimum = 4;
513  const float chisqMaximum = 100.;
514  const int nAllMaximum = 3;
515 
516  // how many Segments?
517  // int nSegments = cscSegments->size();
518 
519  // zero arrays
520  int nAll[600];
521  int nGood[600];
522  for (int i = 0; i < 600; i++) {
523  nAll[i] = 0;
524  nGood[i] = 0;
525  }
526 
527  // -----------------------
528  // loop over segments
529  // -----------------------
530  for (CSCSegmentCollection::const_iterator it = cscSegments->begin(); it != cscSegments->end(); it++) {
531  // which chamber?
532  CSCDetId id = (CSCDetId)(*it).cscDetId();
533  int kEndcap = id.endcap();
534  int kStation = id.station();
535  int kRing = id.ring();
536  int kChamber = id.chamber();
537  int kSerial = chamberSerial(kEndcap, kStation, kRing, kChamber);
538 
539  // segment information
540  float chisq = (*it).chi2();
541  int nhits = (*it).nRecHits();
542 
543  // is this a good segment?
544  bool goodSegment = (nhits >= nhitsMinimum) && (chisq < chisqMaximum);
545 
546  /*
547  LocalPoint localPos = (*it).localPosition();
548  float segX = localPos.x();
549  float segY = localPos.y();
550  std::cout << "E/S/R/Ch: " << kEndcap << "/" << kStation << "/" << kRing << "/" << kChamber
551  << "\tnhits/chisq: " << nhits << "/" << chisq
552  << "\tX/Y: " << segX << "/" << segY
553  << "\tgood? " << goodSegment << std::endl;
554  */
555 
556  // count
557  nAll[kSerial - 1]++;
558  if (goodSegment)
559  nGood[kSerial]++;
560 
561  } // end loop over segments
562 
563  //----------------------
564  // select the event
565  //----------------------
566 
567  // does any chamber have too many segments?
568  bool messyChamber = false;
569  for (int i = 0; i < 600; i++) {
570  if (nAll[i] > nAllMaximum)
571  messyChamber = true;
572  }
573 
574  // are there consecutive chambers with good segments
575  // (This is a little sloppy but is probably fine for skimming...)
576  bool consecutiveChambers = false;
577  for (int i = 0; i < 599; i++) {
578  if ((nGood[i] > 0) && (nGood[i + 1] > 0))
579  consecutiveChambers = true;
580  }
581 
582  bool selectThisEvent = !messyChamber && consecutiveChambers;
583 
584  return selectThisEvent;
585 }

References dtChamberEfficiency_cfi::cscSegments, CSCDetId::endcap(), mps_fire::i, and nhits.

◆ endJob()

void CSCSkim::endJob ( void  )
overridevirtual

Reimplemented from edm::EDFilter.

Definition at line 167 of file CSCSkim.cc.

167  {
168  // Write out results
169 
170  float fraction = 0.;
171  if (nEventsAnalyzed > 0) {
173  }
174 
175  LogInfo("[CSCSkim] Summary") << "\n\n\t====== CSCSkim ==========================================================\n"
176  << "\t\ttype of skim ...............................\t" << typeOfSkim << "\n"
177  << "\t\tevents analyzed ..............\t" << nEventsAnalyzed << "\n"
178  << "\t\tevents selected ..............\t" << nEventsSelected
179  << "\tfraction= " << fraction << std::endl
180  << "\t\tevents chambers both sides ...\t" << nEventsChambersBothSides << "\n"
181  << "\t\tevents w/ overlaps .......... \t" << nEventsOverlappingChambers << "\n"
182  << "\t\tevents lots of hit chambers . \t" << nEventsMessy << "\n"
183  << "\t\tevents from certain chamber . \t" << nEventsCertainChamber << "\n"
184  << "\t\tevents in DT-CSC overlap .... \t" << nEventsDTOverlap << "\n"
185  << "\t\tevents halo-like ............ \t" << nEventsHaloLike << "\n"
186  << "\t\tevents w/ long SA track ..... \t" << nEventsLongSATrack << "\n"
187  << "\t\tevents good for BField ..... \t" << nEventsForBFieldStudies << "\n"
188  << "\t=========================================================================\n\n";
189 
191  // Write the histos to file
192  LogDebug("[CSCSkim]") << "======= write out my histograms ====\n";
193  theHistogramFile->cd();
194  if (makeHistograms) {
195  hxnRecHits->Write();
196  hxnSegments->Write();
197  hxnHitChambers->Write();
198  hxnRecHitsSel->Write();
199  }
201  mevnRecHits0->Write();
202  mevnChambers0->Write();
203  mevnSegments0->Write();
204  mevnRecHits1->Write();
205  mevnChambers1->Write();
206  mevnSegments1->Write();
207  }
208  theHistogramFile->Close();
209  }
210 }

References dqmMemoryStats::float, HLT_2018_cff::fraction, LogDebug, CSCSkim_cfi::makeHistograms, and CosmicsPD_Skims::typeOfSkim.

◆ filter()

bool CSCSkim::filter ( edm::Event event,
const edm::EventSetup eventSetup 
)
overridevirtual

Implements edm::EDFilter.

Definition at line 215 of file CSCSkim.cc.

215  {
216  // increment counter
217  nEventsAnalyzed++;
218 
219  iRun = event.id().run();
220  iEvent = event.id().event();
221 
222  LogDebug("[CSCSkim] EventInfo") << "Run: " << iRun << "\tEvent: " << iEvent << "\tn Analyzed: " << nEventsAnalyzed;
223 
224  // Get the CSC Geometry :
225  ESHandle<CSCGeometry> cscGeom;
226  eventSetup.get<MuonGeometryRecord>().get(cscGeom);
227 
228  // Get the DIGI collections
231 
232  if (event.eventAuxiliary().isRealData()) {
233  event.getByToken(wdr_token, wires);
234  event.getByToken(sdr_token, strips);
235  } else {
236  event.getByToken(wds_token, wires);
237  event.getByToken(sds_token, strips);
238  }
239 
240  // Get the RecHits collection :
242  event.getByToken(rh_token, cscRecHits);
243 
244  // get CSC segment collection
246  event.getByToken(seg_token, cscSegments);
247 
248  // get the cosmic muons collection
250  if (typeOfSkim == 8) {
251  event.getByToken(sam_token, saMuons);
252  }
253 
254  // get the stand-alone muons collection
257  if (typeOfSkim == 9) {
258  event.getByToken(sam_token, saMuons);
259  event.getByToken(trk_token, tracks);
260  event.getByToken(glm_token, gMuons);
261  }
262 
263  //======================================
264  // evaluate the skimming routines
265  //======================================
266 
267  // basic skimming
268  bool basicEvent = false;
269  if (typeOfSkim == 1 || typeOfSkim == 2) {
270  basicEvent = doCSCSkimming(cscRecHits, cscSegments);
271  }
272 
273  // overlapping chamber skim
274  bool goodOverlapEvent = false;
275  if (typeOfSkim == 3) {
276  goodOverlapEvent = doOverlapSkimming(cscSegments);
277  if (goodOverlapEvent) {
279  }
280  }
281 
282  // messy events skim
283  bool messyEvent = false;
284  if (typeOfSkim == 4) {
285  messyEvent = doMessyEventSkimming(cscRecHits, cscSegments);
286  if (messyEvent) {
287  nEventsMessy++;
288  }
289  }
290 
291  // select events with DIGIs in a certain chamber
292  bool hasChamber = false;
293  if (typeOfSkim == 5) {
294  hasChamber = doCertainChamberSelection(wires, strips);
295  if (hasChamber) {
297  }
298  }
299 
300  // select events in the DT-CSC overlap region
301  bool DTOverlapCandidate = false;
302  if (typeOfSkim == 6) {
303  DTOverlapCandidate = doDTOverlap(cscSegments);
304  if (DTOverlapCandidate) {
306  }
307  }
308 
309  // select halo-like events
310  bool HaloLike = false;
311  if (typeOfSkim == 7) {
312  HaloLike = doHaloLike(cscSegments);
313  if (HaloLike) {
314  nEventsHaloLike++;
315  }
316  }
317 
318  // select long cosmic tracks
319  bool LongSATrack = false;
320  if (typeOfSkim == 8) {
321  LongSATrack = doLongSATrack(saMuons);
322  if (LongSATrack) {
324  }
325  }
326 
327  // select events suitable for a B-field study. They have tracks in the tracker.
328  bool GoodForBFieldStudy = false;
329  if (typeOfSkim == 9) {
330  GoodForBFieldStudy = doBFieldStudySelection(saMuons, tracks, gMuons);
331  if (GoodForBFieldStudy) {
333  }
334  }
335 
336  // set filter flag
337  bool selectThisEvent = false;
338  if (typeOfSkim == 1 || typeOfSkim == 2) {
339  selectThisEvent = basicEvent;
340  }
341  if (typeOfSkim == 3) {
342  selectThisEvent = goodOverlapEvent;
343  }
344  if (typeOfSkim == 4) {
345  selectThisEvent = messyEvent;
346  }
347  if (typeOfSkim == 5) {
348  selectThisEvent = hasChamber;
349  }
350  if (typeOfSkim == 6) {
351  selectThisEvent = DTOverlapCandidate;
352  }
353  if (typeOfSkim == 7) {
354  selectThisEvent = HaloLike;
355  }
356  if (typeOfSkim == 8) {
357  selectThisEvent = LongSATrack;
358  }
359  if (typeOfSkim == 9) {
360  selectThisEvent = GoodForBFieldStudy;
361  }
362 
363  if (selectThisEvent) {
364  nEventsSelected++;
365  }
366 
367  return selectThisEvent;
368 }

References dtChamberEfficiency_cfi::cscSegments, edm::EventSetup::get(), get, iEvent, LogDebug, DigiDM_cff::strips, PDWG_EXOHSCP_cff::tracks, CosmicsPD_Skims::typeOfSkim, and DigiDM_cff::wires.

Member Data Documentation

◆ demandChambersBothSides

bool CSCSkim::demandChambersBothSides
private

Definition at line 158 of file CSCSkim.h.

◆ glm_token

edm::EDGetTokenT<reco::MuonCollection> CSCSkim::glm_token
private

Definition at line 150 of file CSCSkim.h.

◆ histogramFileName

std::string CSCSkim::histogramFileName
private

Definition at line 138 of file CSCSkim.h.

◆ hxnHitChambers

TH1F* CSCSkim::hxnHitChambers
private

Definition at line 179 of file CSCSkim.h.

◆ hxnRecHits

TH1F* CSCSkim::hxnRecHits
private

Definition at line 177 of file CSCSkim.h.

◆ hxnRecHitsSel

TH1F* CSCSkim::hxnRecHitsSel
private

Definition at line 180 of file CSCSkim.h.

◆ hxnSegments

TH1F* CSCSkim::hxnSegments
private

Definition at line 178 of file CSCSkim.h.

◆ iEvent

int CSCSkim::iEvent
private

Definition at line 131 of file CSCSkim.h.

◆ iRun

int CSCSkim::iRun
private

Definition at line 130 of file CSCSkim.h.

◆ isSimulation

bool CSCSkim::isSimulation
private

Definition at line 153 of file CSCSkim.h.

◆ makeHistograms

bool CSCSkim::makeHistograms
private

Definition at line 159 of file CSCSkim.h.

◆ makeHistogramsForMessyEvents

bool CSCSkim::makeHistogramsForMessyEvents
private

Definition at line 160 of file CSCSkim.h.

◆ mevnChambers0

TH1F* CSCSkim::mevnChambers0
private

Definition at line 182 of file CSCSkim.h.

◆ mevnChambers1

TH1F* CSCSkim::mevnChambers1
private

Definition at line 185 of file CSCSkim.h.

◆ mevnRecHits0

TH1F* CSCSkim::mevnRecHits0
private

Definition at line 181 of file CSCSkim.h.

◆ mevnRecHits1

TH1F* CSCSkim::mevnRecHits1
private

Definition at line 184 of file CSCSkim.h.

◆ mevnSegments0

TH1F* CSCSkim::mevnSegments0
private

Definition at line 183 of file CSCSkim.h.

◆ mevnSegments1

TH1F* CSCSkim::mevnSegments1
private

Definition at line 186 of file CSCSkim.h.

◆ minimumHitChambers

int CSCSkim::minimumHitChambers
private

Definition at line 156 of file CSCSkim.h.

◆ minimumSegments

int CSCSkim::minimumSegments
private

Definition at line 157 of file CSCSkim.h.

◆ nCSCHitsMin

int CSCSkim::nCSCHitsMin
private

Definition at line 168 of file CSCSkim.h.

◆ nEventsAnalyzed

int CSCSkim::nEventsAnalyzed
private

Definition at line 118 of file CSCSkim.h.

◆ nEventsCertainChamber

int CSCSkim::nEventsCertainChamber
private

Definition at line 123 of file CSCSkim.h.

◆ nEventsChambersBothSides

int CSCSkim::nEventsChambersBothSides
private

Definition at line 120 of file CSCSkim.h.

◆ nEventsDTOverlap

int CSCSkim::nEventsDTOverlap
private

Definition at line 124 of file CSCSkim.h.

◆ nEventsForBFieldStudies

int CSCSkim::nEventsForBFieldStudies
private

Definition at line 127 of file CSCSkim.h.

◆ nEventsHaloLike

int CSCSkim::nEventsHaloLike
private

Definition at line 125 of file CSCSkim.h.

◆ nEventsLongSATrack

int CSCSkim::nEventsLongSATrack
private

Definition at line 126 of file CSCSkim.h.

◆ nEventsMessy

int CSCSkim::nEventsMessy
private

Definition at line 122 of file CSCSkim.h.

◆ nEventsOverlappingChambers

int CSCSkim::nEventsOverlappingChambers
private

Definition at line 121 of file CSCSkim.h.

◆ nEventsSelected

int CSCSkim::nEventsSelected
private

Definition at line 119 of file CSCSkim.h.

◆ nLayersWithHitsMinimum

int CSCSkim::nLayersWithHitsMinimum
private

Definition at line 155 of file CSCSkim.h.

◆ nTrHitsMin

int CSCSkim::nTrHitsMin
private

Definition at line 170 of file CSCSkim.h.

◆ nValidHitsMin

int CSCSkim::nValidHitsMin
private

Definition at line 174 of file CSCSkim.h.

◆ outputFileName

std::string CSCSkim::outputFileName
private

◆ pMin

float CSCSkim::pMin
private

Definition at line 166 of file CSCSkim.h.

◆ redChiSqMax

float CSCSkim::redChiSqMax
private

Definition at line 173 of file CSCSkim.h.

◆ rExtMax

float CSCSkim::rExtMax
private

Definition at line 172 of file CSCSkim.h.

◆ rh_token

edm::EDGetTokenT<CSCRecHit2DCollection> CSCSkim::rh_token
private

Definition at line 146 of file CSCSkim.h.

◆ sam_token

edm::EDGetTokenT<reco::TrackCollection> CSCSkim::sam_token
private

Definition at line 148 of file CSCSkim.h.

◆ sdr_token

edm::EDGetTokenT<CSCStripDigiCollection> CSCSkim::sdr_token
private

Definition at line 144 of file CSCSkim.h.

◆ sds_token

edm::EDGetTokenT<CSCStripDigiCollection> CSCSkim::sds_token
private

Definition at line 142 of file CSCSkim.h.

◆ seg_token

edm::EDGetTokenT<CSCSegmentCollection> CSCSkim::seg_token
private

Definition at line 147 of file CSCSkim.h.

◆ theHistogramFile

TFile* CSCSkim::theHistogramFile
private

Definition at line 134 of file CSCSkim.h.

◆ trk_token

edm::EDGetTokenT<reco::TrackCollection> CSCSkim::trk_token
private

Definition at line 149 of file CSCSkim.h.

◆ typeOfSkim

int CSCSkim::typeOfSkim
private

Definition at line 154 of file CSCSkim.h.

◆ wdr_token

edm::EDGetTokenT<CSCWireDigiCollection> CSCSkim::wdr_token
private

Definition at line 143 of file CSCSkim.h.

◆ wds_token

edm::EDGetTokenT<CSCWireDigiCollection> CSCSkim::wds_token
private

Definition at line 141 of file CSCSkim.h.

◆ whichChamber

int CSCSkim::whichChamber
private

Definition at line 164 of file CSCSkim.h.

◆ whichEndcap

int CSCSkim::whichEndcap
private

Definition at line 161 of file CSCSkim.h.

◆ whichRing

int CSCSkim::whichRing
private

Definition at line 163 of file CSCSkim.h.

◆ whichStation

int CSCSkim::whichStation
private

Definition at line 162 of file CSCSkim.h.

◆ xxnCSCHits

TH1F * CSCSkim::xxnCSCHits
private

Definition at line 188 of file CSCSkim.h.

◆ xxnTrackerHits

TH1F * CSCSkim::xxnTrackerHits
private

Definition at line 188 of file CSCSkim.h.

◆ xxnValidHits

TH1F * CSCSkim::xxnValidHits
private

Definition at line 188 of file CSCSkim.h.

◆ xxP

TH1F* CSCSkim::xxP
private

Definition at line 188 of file CSCSkim.h.

◆ xxredChiSq

TH1F * CSCSkim::xxredChiSq
private

Definition at line 188 of file CSCSkim.h.

◆ zInnerMax

float CSCSkim::zInnerMax
private

Definition at line 169 of file CSCSkim.h.

◆ zLengthMin

float CSCSkim::zLengthMin
private

Definition at line 167 of file CSCSkim.h.

◆ zLengthTrMin

float CSCSkim::zLengthTrMin
private

Definition at line 171 of file CSCSkim.h.

Vector3DBase
Definition: Vector3DBase.h:8
CSCSkim::mevnRecHits0
TH1F * mevnRecHits0
Definition: CSCSkim.h:181
MuonSubdetId::CSC
static constexpr int CSC
Definition: MuonSubdetId.h:12
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
CSCSkim::zLengthMin
float zLengthMin
Definition: CSCSkim.h:167
mps_fire.i
i
Definition: mps_fire.py:355
CSCSkim::makeHistograms
bool makeHistograms
Definition: CSCSkim.h:159
CSCSkim::xxP
TH1F * xxP
Definition: CSCSkim.h:188
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
CSCSkim::rh_token
edm::EDGetTokenT< CSCRecHit2DCollection > rh_token
Definition: CSCSkim.h:146
CSCSkim::hxnRecHitsSel
TH1F * hxnRecHitsSel
Definition: CSCSkim.h:180
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
CSCSkim::doMessyEventSkimming
bool doMessyEventSkimming(edm::Handle< CSCRecHit2DCollection > cscRecHits, edm::Handle< CSCSegmentCollection > cscSegments)
Definition: CSCSkim.cc:593
CSCSkim::doBFieldStudySelection
bool doBFieldStudySelection(edm::Handle< reco::TrackCollection > saTracks, edm::Handle< reco::TrackCollection > Tracks, edm::Handle< reco::MuonCollection > gMuons)
Definition: CSCSkim.cc:1110
muon
Definition: MuonCocktails.h:17
min
T min(T a, T b)
Definition: MathUtil.h:58
CSCDetId::ring
int ring() const
Definition: CSCDetId.h:68
DigiDM_cff.wires
wires
Definition: DigiDM_cff.py:33
CSCSkim::nEventsSelected
int nEventsSelected
Definition: CSCSkim.h:119
CSCSkim::whichChamber
int whichChamber
Definition: CSCSkim.h:164
singleTopDQM_cfi.select
select
Definition: singleTopDQM_cfi.py:50
CSCSkim::hxnRecHits
TH1F * hxnRecHits
Definition: CSCSkim.h:177
edm::LogInfo
Definition: MessageLogger.h:254
CSCSkim::pMin
float pMin
Definition: CSCSkim.h:166
CSCSkim::histogramFileName
std::string histogramFileName
Definition: CSCSkim.h:138
dtChamberEfficiency_cfi.cscSegments
cscSegments
Definition: dtChamberEfficiency_cfi.py:15
spr::goodTrack
bool goodTrack(const reco::Track *pTrack, math::XYZPoint leadPV, trackSelectionParameters parameters, bool debug=false)
Definition: TrackSelection.cc:10
CSCSkim::nTrHitsMin
int nTrHitsMin
Definition: CSCSkim.h:170
HLT_2018_cff.muon
muon
Definition: HLT_2018_cff.py:10349
edm::Handle< CSCWireDigiCollection >
CSCSkim::demandChambersBothSides
bool demandChambersBothSides
Definition: CSCSkim.h:158
CSCSkim::nEventsMessy
int nEventsMessy
Definition: CSCSkim.h:122
CSCSkim::nEventsOverlappingChambers
int nEventsOverlappingChambers
Definition: CSCSkim.h:121
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
CSCSkim::whichRing
int whichRing
Definition: CSCSkim.h:163
CSCSkim::mevnSegments1
TH1F * mevnSegments1
Definition: CSCSkim.h:186
DetId
Definition: DetId.h:17
CSCSkim::minimumSegments
int minimumSegments
Definition: CSCSkim.h:157
reco::HitPattern
Definition: HitPattern.h:147
CSCSkim::nEventsDTOverlap
int nEventsDTOverlap
Definition: CSCSkim.h:124
trackingPlots.hp
hp
Definition: trackingPlots.py:1246
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
CSCSkim::nCSCHitsMin
int nCSCHitsMin
Definition: CSCSkim.h:168
CSCSkim::nLayersWithHitsMinimum
int nLayersWithHitsMinimum
Definition: CSCSkim.h:155
CSCSkim::iEvent
int iEvent
Definition: CSCSkim.h:131
CSCSkim::glm_token
edm::EDGetTokenT< reco::MuonCollection > glm_token
Definition: CSCSkim.h:150
CSCSkim::minimumHitChambers
int minimumHitChambers
Definition: CSCSkim.h:156
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
CSCSkim::mevnChambers1
TH1F * mevnChambers1
Definition: CSCSkim.h:185
CSCDetId::layer
int layer() const
Definition: CSCDetId.h:56
CSCSkim::iRun
int iRun
Definition: CSCSkim.h:130
CSCSkim::sdr_token
edm::EDGetTokenT< CSCStripDigiCollection > sdr_token
Definition: CSCSkim.h:144
edm::ESHandle< CSCGeometry >
CSCSkim::whichStation
int whichStation
Definition: CSCSkim.h:162
CSCSkim::xxredChiSq
TH1F * xxredChiSq
Definition: CSCSkim.h:188
CSCSkim::doDTOverlap
bool doDTOverlap(edm::Handle< CSCSegmentCollection > cscSegments)
Definition: CSCSkim.cc:767
CSCSkim::nEventsLongSATrack
int nEventsLongSATrack
Definition: CSCSkim.h:126
CSCSkim::mevnSegments0
TH1F * mevnSegments0
Definition: CSCSkim.h:183
MuonSubdetId::DT
static constexpr int DT
Definition: MuonSubdetId.h:11
Point3DBase< float, GlobalTag >
CSCSkim::mevnChambers0
TH1F * mevnChambers0
Definition: CSCSkim.h:182
nhits
Definition: HIMultiTrackSelector.h:42
CSCSkim::doHaloLike
bool doHaloLike(edm::Handle< CSCSegmentCollection > cscSegments)
Definition: CSCSkim.cc:886
edm::OwnVector::const_iterator
Definition: OwnVector.h:41
CSCSkim::seg_token
edm::EDGetTokenT< CSCSegmentCollection > seg_token
Definition: CSCSkim.h:147
CSCSkim::hxnHitChambers
TH1F * hxnHitChambers
Definition: CSCSkim.h:179
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
CSCSkim::trk_token
edm::EDGetTokenT< reco::TrackCollection > trk_token
Definition: CSCSkim.h:149
CSCSkim::wds_token
edm::EDGetTokenT< CSCWireDigiCollection > wds_token
Definition: CSCSkim.h:141
CSCSkim::nEventsAnalyzed
int nEventsAnalyzed
Definition: CSCSkim.h:118
CSCSkim::zInnerMax
float zInnerMax
Definition: CSCSkim.h:169
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
CSCSkim::outputFileName
std::string outputFileName
Definition: CSCSkim.h:137
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
CSCSkim::rExtMax
float rExtMax
Definition: CSCSkim.h:172
CSCSkim::whichEndcap
int whichEndcap
Definition: CSCSkim.h:161
CSCSkim::nEventsForBFieldStudies
int nEventsForBFieldStudies
Definition: CSCSkim.h:127
CSCSkim::zLengthTrMin
float zLengthTrMin
Definition: CSCSkim.h:171
edm::RangeMap::const_iterator
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
CSCDetId
Definition: CSCDetId.h:26
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
CSCSkim::doOverlapSkimming
bool doOverlapSkimming(edm::Handle< CSCSegmentCollection > cscSegments)
Definition: CSCSkim.cc:511
createfilelist.int
int
Definition: createfilelist.py:10
CSCSkim::theHistogramFile
TFile * theHistogramFile
Definition: CSCSkim.h:134
CSCSkim::xxnValidHits
TH1F * xxnValidHits
Definition: CSCSkim.h:188
CSCDetId::chamber
int chamber() const
Definition: CSCDetId.h:62
CSCSkim::nValidHitsMin
int nValidHitsMin
Definition: CSCSkim.h:174
get
#define get
CSCSkim::doCSCSkimming
bool doCSCSkimming(edm::Handle< CSCRecHit2DCollection > cscRecHits, edm::Handle< CSCSegmentCollection > cscSegments)
Definition: CSCSkim.cc:376
CSCSkim::sam_token
edm::EDGetTokenT< reco::TrackCollection > sam_token
Definition: CSCSkim.h:148
CSCDetId::endcap
int endcap() const
Definition: CSCDetId.h:85
CSCSkim::hxnSegments
TH1F * hxnSegments
Definition: CSCSkim.h:178
CSCSkim::wdr_token
edm::EDGetTokenT< CSCWireDigiCollection > wdr_token
Definition: CSCSkim.h:143
CSCSkim::nEventsChambersBothSides
int nEventsChambersBothSides
Definition: CSCSkim.h:120
CSCSkim::xxnTrackerHits
TH1F * xxnTrackerHits
Definition: CSCSkim.h:188
CSCSkim::mevnRecHits1
TH1F * mevnRecHits1
Definition: CSCSkim.h:184
CSCSkim::sds_token
edm::EDGetTokenT< CSCStripDigiCollection > sds_token
Definition: CSCSkim.h:142
CSCSkim::typeOfSkim
int typeOfSkim
Definition: CSCSkim.h:154
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
DetId::Muon
Definition: DetId.h:26
CSCSkim::redChiSqMax
float redChiSqMax
Definition: CSCSkim.h:173
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
dummy
Definition: DummySelector.h:38
CSCSkim::doCertainChamberSelection
bool doCertainChamberSelection(edm::Handle< CSCWireDigiCollection > wires, edm::Handle< CSCStripDigiCollection > strips)
Definition: CSCSkim.cc:729
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
event
Definition: event.py:1
CSCSkim::doLongSATrack
bool doLongSATrack(edm::Handle< reco::TrackCollection > saTracks)
Definition: CSCSkim.cc:1044
DigiContainerIterator
Definition: MuonDigiCollection.h:30
CSCSkim::xxnCSCHits
TH1F * xxnCSCHits
Definition: CSCSkim.h:188
CSCSkim::makeHistogramsForMessyEvents
bool makeHistogramsForMessyEvents
Definition: CSCSkim.h:160
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
HLT_2018_cff.fraction
fraction
Definition: HLT_2018_cff.py:51317
edm::InputTag
Definition: InputTag.h:15
DigiDM_cff.strips
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers....
Definition: DigiDM_cff.py:32
CSCSkim::nEventsCertainChamber
int nEventsCertainChamber
Definition: CSCSkim.h:123
hit
Definition: SiStripHitEffFromCalibTree.cc:88
kLayer
static const std::string kLayer("layer")
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
CSCSkim::chamberSerial
int chamberSerial(int kE, int kS, int kR, int kCh)
Definition: CSCSkim.cc:1294
CSCSkim::nEventsHaloLike
int nEventsHaloLike
Definition: CSCSkim.h:125