CMS 3D CMS Logo

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

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

Inheritance diagram for RPCNoise:
edm::one::EDFilter<> edm::one::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 RPCNoise (const edm::ParameterSet &)
 
 ~RPCNoise () override
 
- Public Member Functions inherited from edm::one::EDFilter<>
 EDFilter ()=default
 
 EDFilter (const EDFilter &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDFilteroperator= (const EDFilter &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDFilterBase () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
bool filter (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

TH1F * dOrbit
 
TH1F * fDTDigisOut
 
TH1F * fDTDigisOutH
 
bool fillHistograms
 
int firstOrbit
 
std::string histogramFileName
 
TProfile * hitsVsOrbit
 
TProfile * hitsVsSerial
 
int iEvent
 
int iRun
 
int lastOrbit
 
int nCSCStripsCut
 
int nCSCWiresCut
 
TH1F * nDTDigis
 
int nDTDigisCut
 
TH1F * nDTDigisH
 
TH1F * nDTDigisIn
 
TH1F * nDTDigisInH
 
TH1F * nDTDigisOut
 
TH1F * nDTDigisOutH
 
int nEventsAnalyzed
 
int nEventsSelected
 
int nRPCHitsCut
 
TH1F * nRPCRecHits
 
TH1F * nRPCRecHitsLong
 
TH1F * nStrips
 
TH1F * nStripsH
 
TH1F * nWires
 
TH1F * nWiresH
 
TProfile * orbitVsSerial
 
TH1F * RPCBX
 
TH1F * RPCBXH
 
TH1F * RPCClSize
 
TH1F * RPCClSizeH
 
TH1F * rpcCorner
 
TH1F * rpcCornerH
 
TProfile * rpcCornerVsOrbit
 
TH1F * rpcLayer
 
TH1F * rpcLayerH
 
TH1F * rpcRing
 
TH1F * rpcRingH
 
TProfile * rpcRingVsOrbit
 
TH1F * rpcSector
 
TH1F * rpcSectorH
 
TProfile * rpcSectorVsOrbit
 
TH1F * rpcStation
 
TH1F * rpcStationH
 
TProfile * rpcStationVsOrbit
 
TH1F * t0All
 
TH1F * t0AllH
 
TFile * theHistogramFile
 
int thisOrbit
 

Additional Inherited Members

- Public Types inherited from edm::one::EDFilterBase
typedef EDFilterBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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::one::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: <simple analyis of RPC noise, and event filter>

Implementation: <simple application="" of="" edfilter>="">

Definition at line 87 of file RPCNoise.cc.

Constructor & Destructor Documentation

◆ RPCNoise()

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

Definition at line 156 of file RPCNoise.cc.

References RPCNoise_cfi::fillHistograms, CSCSkim_cfi::histogramFileName, RPCNoise_cfi::nCSCStripsCut, RPCNoise_cfi::nCSCWiresCut, RPCNoise_cfi::nDTDigisCut, RPCNoise_cfi::nRPCHitsCut, muonDTDigis_cfi::pset, and AlCaHLTBitMon_QueryRunRegistry::string.

156  {
157  histogramFileName = pset.getUntrackedParameter<std::string>("histogramFileName", "histos.root");
158  fillHistograms = pset.getUntrackedParameter<bool>("fillHistograms", true);
159  nRPCHitsCut = pset.getUntrackedParameter<int>("nRPCHitsCut", 40);
160  nCSCStripsCut = pset.getUntrackedParameter<int>("nCSCStripsCut", 50);
161  nCSCWiresCut = pset.getUntrackedParameter<int>("nCSCWiresCut", 10);
162  nDTDigisCut = pset.getUntrackedParameter<int>("nDTDigisCut", 10);
163 }
int nRPCHitsCut
Definition: RPCNoise.cc:107
std::string histogramFileName
Definition: RPCNoise.cc:112
int nCSCStripsCut
Definition: RPCNoise.cc:108
int nCSCWiresCut
Definition: RPCNoise.cc:109
bool fillHistograms
Definition: RPCNoise.cc:106
int nDTDigisCut
Definition: RPCNoise.cc:110

◆ ~RPCNoise()

RPCNoise::~RPCNoise ( )
override

Definition at line 164 of file RPCNoise.cc.

164 {}

Member Function Documentation

◆ beginJob()

void RPCNoise::beginJob ( )
overrideprivatevirtual

Reimplemented from edm::one::EDFilterBase.

Definition at line 166 of file RPCNoise.cc.

References RPCNoise_cfi::fillHistograms, CSCSkim_cfi::histogramFileName, iEvent, and me0TriggerPseudoDigis_cff::nStrips.

166  {
167  // initialize variables
168  nEventsAnalyzed = 0;
169  nEventsSelected = 0;
170  iRun = 0;
171  iEvent = 0;
173 
174  if (fillHistograms) {
175  // Create the root file for the histograms
176  theHistogramFile = new TFile(histogramFileName.c_str(), "RECREATE");
177  theHistogramFile->cd();
178  // book histograms
179  nWires = new TH1F("nWires", "number of wire digis", 121, -0.5, 120.5);
180  nStrips = new TH1F("nStrips", "number of strip digis", 201, -0.5, 200.5);
181  nWiresH = new TH1F("nWiresH", "number of wire digis HIGH", 121, -0.5, 120.5);
182  nStripsH = new TH1F("nStripsH", "number of strip digis HIGH", 201, -0.5, 200.5);
183  nDTDigis = new TH1F("nDTDigis", "number of DT digis", 201, -0.5, 200.5);
184  nDTDigisH = new TH1F("nDTDigisH", "number of DT digis HIGH", 201, -0.5, 200.5);
185  nDTDigisIn = new TH1F("nDTDigisIn", "N DT digis in window", 75, 0., 150.);
186  nDTDigisInH = new TH1F("nDTDigisInH", "N DT digis in window HIGH", 75, 0., 150.);
187  nDTDigisOut = new TH1F("nDTDigisOut", "N DT digis out window", 75, 0., 150.);
188  nDTDigisOutH = new TH1F("nDTDigisOutH", "N DT digis out window HIGH", 75, 0., 150.);
189  fDTDigisOut = new TH1F("fDTDigisOut", "fraction DT digis outside window", 55, 0., 1.1);
190  fDTDigisOutH = new TH1F("fDTDigisOutH", "fraction DT digis outside window HIGH", 55, 0., 1.1);
191 
192  t0All = new TH1F("t0All", "t0", 700, 0., 7000.);
193  t0AllH = new TH1F("t0AllH", "t0 HIGH", 700, 0., 7000.);
194  RPCBX = new TH1F("RPCBX", "RPC BX", 21, -10.5, 10.5);
195  RPCBXH = new TH1F("RPCBXH", "RPC BX HIGH", 21, -10.5, 10.5);
196  RPCClSize = new TH1F("RPCClSize", "RPC cluster size", 61, -0.5, 60.5);
197  RPCClSizeH = new TH1F("RPCClSizeH", "RPC cluster size HIGH", 61, -0.5, 60.5);
198 
199  nRPCRecHits = new TH1F("nRPCRecHits", "number of RPC RecHits", 101, -0.5, 100.5);
200  nRPCRecHitsLong = new TH1F("nRPCRecHitsLong", "number of RPC RecHits", 601, -0.5, 600.5);
201  hitsVsSerial = new TProfile("hitsVsSerial", "mean RPC hits vs serial event number", 4000, 0., 40000., 0., 1000.);
202  orbitVsSerial =
203  new TProfile("orbitVsSerial", "relative orbit number vs serial event number", 4000, 0., 40000., 0., 1.e10);
204  hitsVsOrbit = new TProfile("hitsVsOrbit", "mean RPC hits vs orbit number", 3000, 0., 1200000., 0., 1000.);
205  dOrbit = new TH1F("dOrbit", "difference in orbit number", 121, -0.5, 120.5);
206 
207  rpcStation = new TH1F("rpcStation", "RPC station", 6, -0.5, 5.5);
208  rpcStationH = new TH1F("rpcStationH", "RPC station HIGH", 6, -0.5, 5.5);
209  rpcRing = new TH1F("rpcRing", "RPC ring", 9, -4.5, 4.5);
210  rpcRingH = new TH1F("rpcRingH", "RPC ring HIGH", 9, -4.5, 4.5);
211  rpcSector = new TH1F("rpcSector", "RPC sector", 15, -0.5, 14.5);
212  rpcSectorH = new TH1F("rpcSectorH", "RPC sector HIGH", 15, -0.5, 14.5);
213  rpcLayer = new TH1F("rpcLayer", "RPC layer", 4, -0.5, 3.5);
214  rpcLayerH = new TH1F("rpcLayerH", "RPC layer HIGH", 4, -0.5, 3.5);
215  rpcStationVsOrbit = new TProfile("rpcStationVsOrbit", "mean RPC station vs. Orbit", 3000, 0., 1200000., 0., 20.);
216  rpcSectorVsOrbit = new TProfile("rpcSectorVsOrbit", "mean RPC sector vs. Orbit", 3000, 0., 1200000., 0., 20.);
217  rpcRingVsOrbit = new TProfile("rpcRingVsOrbit", "mean RPC ring vs. Orbit", 3000, 0., 1200000., -20., 20.);
218  rpcCorner = new TH1F("rpcCorner", "special corner designation", 4, -0.5, 3.5);
219  rpcCornerH = new TH1F("rpcCornerH", "special corner designation HIGH", 4, -0.5, 3.5);
220  rpcCornerVsOrbit = new TProfile("rpcCornerVsOrbit", "special corner vs. Orbit", 3000, 0., 1200000., -20., 20.);
221  }
222 }
TH1F * rpcStation
Definition: RPCNoise.cc:140
TH1F * rpcCorner
Definition: RPCNoise.cc:151
TH1F * t0All
Definition: RPCNoise.cc:122
TProfile * rpcStationVsOrbit
Definition: RPCNoise.cc:148
TH1F * t0AllH
Definition: RPCNoise.cc:123
TProfile * hitsVsSerial
Definition: RPCNoise.cc:132
int iEvent
Definition: RPCNoise.cc:101
int firstOrbit
Definition: RPCNoise.cc:102
TH1F * nStripsH
Definition: RPCNoise.cc:119
TH1F * rpcRingH
Definition: RPCNoise.cc:143
TH1F * rpcStationH
Definition: RPCNoise.cc:141
TH1F * rpcRing
Definition: RPCNoise.cc:142
TH1F * RPCBX
Definition: RPCNoise.cc:136
TH1F * fDTDigisOutH
Definition: RPCNoise.cc:129
TH1F * nRPCRecHits
Definition: RPCNoise.cc:130
TH1F * rpcLayer
Definition: RPCNoise.cc:146
TH1F * RPCClSizeH
Definition: RPCNoise.cc:139
TH1F * nDTDigisH
Definition: RPCNoise.cc:121
TProfile * rpcSectorVsOrbit
Definition: RPCNoise.cc:149
TH1F * dOrbit
Definition: RPCNoise.cc:135
TH1F * nWiresH
Definition: RPCNoise.cc:118
int iRun
Definition: RPCNoise.cc:100
TH1F * rpcCornerH
Definition: RPCNoise.cc:152
TH1F * RPCClSize
Definition: RPCNoise.cc:137
int nEventsAnalyzed
Definition: RPCNoise.cc:98
int thisOrbit
Definition: RPCNoise.cc:104
TH1F * nDTDigisOutH
Definition: RPCNoise.cc:127
TH1F * nDTDigisOut
Definition: RPCNoise.cc:126
TProfile * rpcCornerVsOrbit
Definition: RPCNoise.cc:153
TH1F * rpcSector
Definition: RPCNoise.cc:144
TH1F * nRPCRecHitsLong
Definition: RPCNoise.cc:131
int lastOrbit
Definition: RPCNoise.cc:103
int nEventsSelected
Definition: RPCNoise.cc:99
TH1F * RPCBXH
Definition: RPCNoise.cc:138
TFile * theHistogramFile
Definition: RPCNoise.cc:114
TH1F * rpcLayerH
Definition: RPCNoise.cc:147
TH1F * nDTDigisIn
Definition: RPCNoise.cc:124
std::string histogramFileName
Definition: RPCNoise.cc:112
TProfile * orbitVsSerial
Definition: RPCNoise.cc:133
TH1F * nWires
Definition: RPCNoise.cc:116
TH1F * nStrips
Definition: RPCNoise.cc:117
TProfile * rpcRingVsOrbit
Definition: RPCNoise.cc:150
TH1F * nDTDigis
Definition: RPCNoise.cc:120
TProfile * hitsVsOrbit
Definition: RPCNoise.cc:134
TH1F * nDTDigisInH
Definition: RPCNoise.cc:125
TH1F * rpcSectorH
Definition: RPCNoise.cc:145
TH1F * fDTDigisOut
Definition: RPCNoise.cc:128
bool fillHistograms
Definition: RPCNoise.cc:106

◆ endJob()

void RPCNoise::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDFilterBase.

Definition at line 224 of file RPCNoise.cc.

References gather_cfg::cout, RPCNoise_cfi::fillHistograms, and me0TriggerPseudoDigis_cff::nStrips.

224  {
225  std::cout << "\n\t===============================================================\n"
226  << "\tnumber of events analyzed = " << nEventsAnalyzed << std::endl
227  << "\tnumber of events selected = " << nEventsSelected << std::endl
228  << "\tfirst and last orbit number : " << firstOrbit << ", " << lastOrbit << ", "
229  << lastOrbit - firstOrbit << std::endl
230  << "\t===============================================================\n\n";
231 
232  if (fillHistograms) {
233  // Write the histos to file
234  printf("\n\n======= write out my histograms ====\n\n");
235  theHistogramFile->cd();
236  nWires->Write();
237  nStrips->Write();
238  nWiresH->Write();
239  nStripsH->Write();
240  nDTDigis->Write();
241  nDTDigisH->Write();
242  nDTDigisIn->Write();
243  nDTDigisInH->Write();
244  nDTDigisOut->Write();
245  nDTDigisOutH->Write();
246  fDTDigisOut->Write();
247  fDTDigisOutH->Write();
248  nRPCRecHits->Write();
249  nRPCRecHitsLong->Write();
250  hitsVsSerial->Write();
251  hitsVsOrbit->Write();
252  orbitVsSerial->Write();
253  t0All->Write();
254  t0AllH->Write();
255  RPCBX->Write();
256  RPCClSize->Write();
257  RPCBXH->Write();
258  RPCClSizeH->Write();
259  rpcStation->Write();
260  rpcStationH->Write();
261  rpcRing->Write();
262  rpcRingH->Write();
263  rpcSector->Write();
264  rpcSectorH->Write();
265  rpcLayer->Write();
266  rpcLayerH->Write();
267  dOrbit->Write();
268  rpcStationVsOrbit->Write();
269  rpcSectorVsOrbit->Write();
270  rpcRingVsOrbit->Write();
271  rpcCorner->Write();
272  rpcCornerH->Write();
273  rpcCornerVsOrbit->Write();
274  theHistogramFile->Close();
275  }
276 }
TH1F * rpcStation
Definition: RPCNoise.cc:140
TH1F * rpcCorner
Definition: RPCNoise.cc:151
TH1F * t0All
Definition: RPCNoise.cc:122
TProfile * rpcStationVsOrbit
Definition: RPCNoise.cc:148
TH1F * t0AllH
Definition: RPCNoise.cc:123
TProfile * hitsVsSerial
Definition: RPCNoise.cc:132
int firstOrbit
Definition: RPCNoise.cc:102
TH1F * nStripsH
Definition: RPCNoise.cc:119
TH1F * rpcRingH
Definition: RPCNoise.cc:143
TH1F * rpcStationH
Definition: RPCNoise.cc:141
TH1F * rpcRing
Definition: RPCNoise.cc:142
TH1F * RPCBX
Definition: RPCNoise.cc:136
TH1F * fDTDigisOutH
Definition: RPCNoise.cc:129
TH1F * nRPCRecHits
Definition: RPCNoise.cc:130
TH1F * rpcLayer
Definition: RPCNoise.cc:146
TH1F * RPCClSizeH
Definition: RPCNoise.cc:139
TH1F * nDTDigisH
Definition: RPCNoise.cc:121
TProfile * rpcSectorVsOrbit
Definition: RPCNoise.cc:149
TH1F * dOrbit
Definition: RPCNoise.cc:135
TH1F * nWiresH
Definition: RPCNoise.cc:118
TH1F * rpcCornerH
Definition: RPCNoise.cc:152
TH1F * RPCClSize
Definition: RPCNoise.cc:137
int nEventsAnalyzed
Definition: RPCNoise.cc:98
TH1F * nDTDigisOutH
Definition: RPCNoise.cc:127
TH1F * nDTDigisOut
Definition: RPCNoise.cc:126
TProfile * rpcCornerVsOrbit
Definition: RPCNoise.cc:153
TH1F * rpcSector
Definition: RPCNoise.cc:144
TH1F * nRPCRecHitsLong
Definition: RPCNoise.cc:131
int lastOrbit
Definition: RPCNoise.cc:103
int nEventsSelected
Definition: RPCNoise.cc:99
TH1F * RPCBXH
Definition: RPCNoise.cc:138
TFile * theHistogramFile
Definition: RPCNoise.cc:114
TH1F * rpcLayerH
Definition: RPCNoise.cc:147
TH1F * nDTDigisIn
Definition: RPCNoise.cc:124
TProfile * orbitVsSerial
Definition: RPCNoise.cc:133
TH1F * nWires
Definition: RPCNoise.cc:116
TH1F * nStrips
Definition: RPCNoise.cc:117
TProfile * rpcRingVsOrbit
Definition: RPCNoise.cc:150
TH1F * nDTDigis
Definition: RPCNoise.cc:120
TProfile * hitsVsOrbit
Definition: RPCNoise.cc:134
TH1F * nDTDigisInH
Definition: RPCNoise.cc:125
TH1F * rpcSectorH
Definition: RPCNoise.cc:145
TH1F * fDTDigisOut
Definition: RPCNoise.cc:128
bool fillHistograms
Definition: RPCNoise.cc:106

◆ filter()

bool RPCNoise::filter ( edm::Event event,
const edm::EventSetup eventSetup 
)
overrideprivatevirtual

Implements edm::one::EDFilterBase.

Definition at line 278 of file RPCNoise.cc.

References simKBmtfDigis_cfi::bx, gather_cfg::cout, RPCNoise_cfi::fillHistograms, dqmMemoryStats::float, iEvent, kLayer(), SiStripPI::min, RPCNoise_cfi::nCSCStripsCut, RPCNoise_cfi::nCSCWiresCut, RPCNoise_cfi::nDTDigisCut, RPCNoise_cfi::nRPCHitsCut, me0TriggerPseudoDigis_cff::nStrips, RPCDetId::region(), rpcRecHits_cfi::rpcRecHits, DigiDM_cff::strips, FrontierCondition_GT_autoExpress_cfi::t0, and DigiDM_cff::wires.

278  {
279  bool selectThisEvent = false;
280 
281  // increment counter
282  nEventsAnalyzed++;
283 
284  iRun = event.id().run();
285  iEvent = event.id().event();
286 
287  bool printThisLine = (nEventsAnalyzed % 100 == 0);
288  if (printThisLine) {
289  std::cout << "======================================"
290  << " analyzed= " << nEventsAnalyzed << ", selected= " << nEventsSelected << "\trun,event: " << iRun
291  << ", " << iEvent << std::endl;
292  }
293 
294  /*
295  const edm::Timestamp jTime = event.time();
296  unsigned int sec = jTime.value() >> 32;
297  unsigned int usec = 0xFFFFFFFF & jTime.value() ;
298  double floatTime = sec + usec/(float)1000000.;
299  */
300 
301  // first event gives
302  // sec = 1225315493
303  // orbit = 202375185
304  // bx = 764
305  // mtime = 205094517
306  int bx = event.bunchCrossing();
307  int thisOrbit = event.orbitNumber();
308  long mTime = 3564 * thisOrbit + bx;
309  if (firstOrbit == 0) {
312  }
313  int deltaOrbit = thisOrbit - lastOrbit;
315  int relativeOrbit = thisOrbit - firstOrbit;
316 
317  if (fillHistograms) {
318  dOrbit->Fill(deltaOrbit);
319  }
320 
321  if (nEventsAnalyzed < 200) {
322  std::cout << iEvent
323  // << "\tsec,usec: " << sec << ", " << usec
324  // << "\tfloatTime= " << std::setprecision(16) << floatTime
325  // << "\tctime: " << ctime(sec)
326  << "\torbit,bx,mTime: " << thisOrbit << "," << bx << "," << mTime << "\tdelta= " << deltaOrbit
327  << std::endl;
328  }
329 
330  // ================
331  // RPC recHits
332  // ================
334  event.getByLabel("rpcRecHits", "", rpcRecHits);
335 
336  // count the number of RPC rechits
337  int nRPC = 0;
339  for (rpcIt = rpcRecHits->begin(); rpcIt != rpcRecHits->end(); rpcIt++) {
340  // RPCDetId id = (RPCDetId)(*rpcIt).rpcId();
341  // LocalPoint rhitlocal = (*rpcIt).localPosition();
342  nRPC++;
343  }
344 
345  // loop again, this time fill histograms
346  for (rpcIt = rpcRecHits->begin(); rpcIt != rpcRecHits->end(); rpcIt++) {
347  RPCDetId id = (RPCDetId)(*rpcIt).rpcId();
348  int kRegion = id.region();
349  int kStation = id.station();
350  int kRing = id.ring();
351  int kSector = id.sector();
352  int kLayer = id.layer();
353  int bx = (*rpcIt).BunchX();
354  int clSize = (*rpcIt).clusterSize();
355  int cornerFlag = 0;
356  if ((kStation > 3) && (kSector < 3)) {
357  cornerFlag = 1;
358  if (kRing < 0)
359  cornerFlag = 2;
360  }
361  if (nEventsAnalyzed < 100) {
362  std::cout << "Region/Station/Ring/Sector/Layer: " << kRegion << " / " << kStation << " / " << kRing << " / "
363  << kSector << " / " << kLayer << "\tbx,clSize: " << bx << ", " << clSize << std::endl;
364  }
365  if (fillHistograms) {
366  RPCBX->Fill(bx);
367  RPCClSize->Fill(min((float)clSize, (float)60.));
368  rpcStation->Fill(kStation);
369  rpcRing->Fill(kRing);
370  rpcSector->Fill(kSector);
371  rpcLayer->Fill(kLayer);
372  rpcStationVsOrbit->Fill(relativeOrbit, kStation);
373  rpcSectorVsOrbit->Fill(relativeOrbit, kSector);
374  rpcRingVsOrbit->Fill(relativeOrbit, kRing);
375  rpcCorner->Fill(cornerFlag);
376  rpcCornerVsOrbit->Fill(relativeOrbit, cornerFlag);
377  if (nRPC > nRPCHitsCut) {
378  RPCBXH->Fill(bx);
379  RPCClSizeH->Fill(min((float)clSize, (float)60.));
380  rpcStationH->Fill(kStation);
381  rpcRingH->Fill(kRing);
382  rpcSectorH->Fill(kSector);
383  rpcLayerH->Fill(kLayer);
384  rpcCornerH->Fill(cornerFlag);
385  }
386  }
387  }
388 
389  // ===============
390  // CSC DIGIs
391  // ===============
394  event.getByLabel("muonCSCDigis", "MuonCSCWireDigi", wires);
395  event.getByLabel("muonCSCDigis", "MuonCSCStripDigi", strips);
396 
397  // count the number of wire digis.
398  int nW = 0;
399  for (CSCWireDigiCollection::DigiRangeIterator jW = wires->begin(); jW != wires->end(); jW++) {
400  std::vector<CSCWireDigi>::const_iterator wireIterA = (*jW).second.first;
401  std::vector<CSCWireDigi>::const_iterator lWireA = (*jW).second.second;
402  for (; wireIterA != lWireA; ++wireIterA) {
403  nW++;
404  }
405  }
406 
407  // count the number of fired strips.
408  // I am using a crude indicator of signal - this is fast and adequate for
409  // this purpose, but it would be poor for actual CSC studies.
410  int nS = 0;
411  for (CSCStripDigiCollection::DigiRangeIterator jS = strips->begin(); jS != strips->end(); jS++) {
412  std::vector<CSCStripDigi>::const_iterator stripItA = (*jS).second.first;
413  std::vector<CSCStripDigi>::const_iterator lastStripA = (*jS).second.second;
414  for (; stripItA != lastStripA; ++stripItA) {
415  std::vector<int> myADCVals = stripItA->getADCCounts();
416  int iDiff = myADCVals[4] + myADCVals[5] - myADCVals[0] - myADCVals[1];
417  if (iDiff > 30) {
418  nS++;
419  }
420  }
421  }
422 
423  // ===============
424  // DT DIGIs
425  // ===============
426  // see: CalibMuon/DTCalibration/plugins/DTT0Calibration.cc
428  event.getByLabel("muonDTDigis", dtDIGIs);
429 
430  // count the number of digis.
431  int nDT = 0;
432  int nDTin = 0;
433  int nDTout = 0;
434  for (DTDigiCollection::DigiRangeIterator jDT = dtDIGIs->begin(); jDT != dtDIGIs->end(); ++jDT) {
435  const DTDigiCollection::Range &digiRange = (*jDT).second;
436  for (DTDigiCollection::const_iterator digi = digiRange.first; digi != digiRange.second; digi++) {
437  double t0 = (*digi).countsTDC();
438  nDT++;
439  if ((t0 > 3050) && (t0 < 3700)) {
440  nDTin++;
441  } else {
442  nDTout++;
443  }
444  if (fillHistograms) {
445  t0All->Fill(t0);
446  if (nRPC > nRPCHitsCut) {
447  t0AllH->Fill(t0);
448  }
449  }
450  }
451  }
452 
453  //==============
454  // Analysis
455  //==============
456 
457  if (nEventsAnalyzed < 1000) {
458  std::cout << "\tnumber of CSC DIGIS = " << nW << ", " << nS << "\tDT DIGIS = " << nDT << "\tRPC Rechits = " << nRPC
459  << std::endl;
460  }
461 
462  if (fillHistograms) {
463  nWires->Fill(min((float)nW, (float)120.));
464  nStrips->Fill(min((float)nS, (float)200.));
465 
466  nDTDigis->Fill(min((float)nDT, (float)200.));
467  nDTDigisIn->Fill(min((float)nDTin, (float)200.));
468  nDTDigisOut->Fill(min((float)nDTout, (float)200.));
469  if (nDT > 0) {
470  float fracOut = float(nDTout) / float(nDT);
471  fDTDigisOut->Fill(fracOut);
472  }
473  nRPCRecHits->Fill(min((float)nRPC, (float)100.));
474  nRPCRecHitsLong->Fill(min((float)nRPC, (float)1000.));
475  hitsVsSerial->Fill(nEventsAnalyzed, nRPC);
476  hitsVsOrbit->Fill(relativeOrbit, nRPC);
477  orbitVsSerial->Fill(nEventsAnalyzed, relativeOrbit);
478 
479  if (nRPC > nRPCHitsCut) {
480  nWiresH->Fill(min((float)nW, (float)120.));
481  nStripsH->Fill(min((float)nS, (float)200.));
482  nDTDigisH->Fill(min((float)nDT, (float)200.));
483  nDTDigisInH->Fill(min((float)nDTin, (float)200.));
484  nDTDigisOutH->Fill(min((float)nDTout, (float)200.));
485  if (nDT > 0) {
486  float fracOut = float(nDTout) / float(nDT);
487  fDTDigisOutH->Fill(fracOut);
488  }
489  }
490  }
491 
492  // select this event for output?
493 
494  selectThisEvent = (nRPC > nRPCHitsCut) && (nW > nCSCWiresCut || nS > nCSCStripsCut) && (nDT > nDTDigisCut);
495  if (selectThisEvent) {
496  nEventsSelected++;
497  }
498 
499  return selectThisEvent;
500 }
TH1F * rpcStation
Definition: RPCNoise.cc:140
TH1F * rpcCorner
Definition: RPCNoise.cc:151
int nRPCHitsCut
Definition: RPCNoise.cc:107
TH1F * t0All
Definition: RPCNoise.cc:122
TProfile * rpcStationVsOrbit
Definition: RPCNoise.cc:148
TH1F * t0AllH
Definition: RPCNoise.cc:123
TProfile * hitsVsSerial
Definition: RPCNoise.cc:132
int iEvent
Definition: RPCNoise.cc:101
int firstOrbit
Definition: RPCNoise.cc:102
TH1F * nStripsH
Definition: RPCNoise.cc:119
TH1F * rpcRingH
Definition: RPCNoise.cc:143
TH1F * rpcStationH
Definition: RPCNoise.cc:141
TH1F * rpcRing
Definition: RPCNoise.cc:142
TH1F * RPCBX
Definition: RPCNoise.cc:136
TH1F * fDTDigisOutH
Definition: RPCNoise.cc:129
TH1F * nRPCRecHits
Definition: RPCNoise.cc:130
TH1F * rpcLayer
Definition: RPCNoise.cc:146
TH1F * RPCClSizeH
Definition: RPCNoise.cc:139
C::const_iterator const_iterator
constant access iterator type
Definition: RangeMap.h:43
TH1F * nDTDigisH
Definition: RPCNoise.cc:121
TProfile * rpcSectorVsOrbit
Definition: RPCNoise.cc:149
TH1F * dOrbit
Definition: RPCNoise.cc:135
TH1F * nWiresH
Definition: RPCNoise.cc:118
int iRun
Definition: RPCNoise.cc:100
TH1F * rpcCornerH
Definition: RPCNoise.cc:152
TH1F * RPCClSize
Definition: RPCNoise.cc:137
int nEventsAnalyzed
Definition: RPCNoise.cc:98
static const std::string kLayer("layer")
int thisOrbit
Definition: RPCNoise.cc:104
TH1F * nDTDigisOutH
Definition: RPCNoise.cc:127
TH1F * nDTDigisOut
Definition: RPCNoise.cc:126
TProfile * rpcCornerVsOrbit
Definition: RPCNoise.cc:153
TH1F * rpcSector
Definition: RPCNoise.cc:144
TH1F * nRPCRecHitsLong
Definition: RPCNoise.cc:131
int lastOrbit
Definition: RPCNoise.cc:103
int nEventsSelected
Definition: RPCNoise.cc:99
std::pair< const_iterator, const_iterator > Range
TH1F * RPCBXH
Definition: RPCNoise.cc:138
std::vector< DigiType >::const_iterator const_iterator
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
TH1F * rpcLayerH
Definition: RPCNoise.cc:147
TH1F * nDTDigisIn
Definition: RPCNoise.cc:124
TProfile * orbitVsSerial
Definition: RPCNoise.cc:133
TH1F * nWires
Definition: RPCNoise.cc:116
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
Definition: DigiDM_cff.py:32
TH1F * nStrips
Definition: RPCNoise.cc:117
TProfile * rpcRingVsOrbit
Definition: RPCNoise.cc:150
int nCSCStripsCut
Definition: RPCNoise.cc:108
TH1F * nDTDigis
Definition: RPCNoise.cc:120
TProfile * hitsVsOrbit
Definition: RPCNoise.cc:134
TH1F * nDTDigisInH
Definition: RPCNoise.cc:125
int nCSCWiresCut
Definition: RPCNoise.cc:109
TH1F * rpcSectorH
Definition: RPCNoise.cc:145
TH1F * fDTDigisOut
Definition: RPCNoise.cc:128
bool fillHistograms
Definition: RPCNoise.cc:106
int nDTDigisCut
Definition: RPCNoise.cc:110

Member Data Documentation

◆ dOrbit

TH1F* RPCNoise::dOrbit
private

Definition at line 135 of file RPCNoise.cc.

◆ fDTDigisOut

TH1F* RPCNoise::fDTDigisOut
private

Definition at line 128 of file RPCNoise.cc.

◆ fDTDigisOutH

TH1F* RPCNoise::fDTDigisOutH
private

Definition at line 129 of file RPCNoise.cc.

◆ fillHistograms

bool RPCNoise::fillHistograms
private

Definition at line 106 of file RPCNoise.cc.

◆ firstOrbit

int RPCNoise::firstOrbit
private

Definition at line 102 of file RPCNoise.cc.

◆ histogramFileName

std::string RPCNoise::histogramFileName
private

Definition at line 112 of file RPCNoise.cc.

◆ hitsVsOrbit

TProfile* RPCNoise::hitsVsOrbit
private

Definition at line 134 of file RPCNoise.cc.

◆ hitsVsSerial

TProfile* RPCNoise::hitsVsSerial
private

Definition at line 132 of file RPCNoise.cc.

◆ iEvent

int RPCNoise::iEvent
private

Definition at line 101 of file RPCNoise.cc.

◆ iRun

int RPCNoise::iRun
private

Definition at line 100 of file RPCNoise.cc.

◆ lastOrbit

int RPCNoise::lastOrbit
private

Definition at line 103 of file RPCNoise.cc.

◆ nCSCStripsCut

int RPCNoise::nCSCStripsCut
private

Definition at line 108 of file RPCNoise.cc.

◆ nCSCWiresCut

int RPCNoise::nCSCWiresCut
private

Definition at line 109 of file RPCNoise.cc.

◆ nDTDigis

TH1F* RPCNoise::nDTDigis
private

Definition at line 120 of file RPCNoise.cc.

◆ nDTDigisCut

int RPCNoise::nDTDigisCut
private

Definition at line 110 of file RPCNoise.cc.

◆ nDTDigisH

TH1F* RPCNoise::nDTDigisH
private

Definition at line 121 of file RPCNoise.cc.

◆ nDTDigisIn

TH1F* RPCNoise::nDTDigisIn
private

Definition at line 124 of file RPCNoise.cc.

◆ nDTDigisInH

TH1F* RPCNoise::nDTDigisInH
private

Definition at line 125 of file RPCNoise.cc.

◆ nDTDigisOut

TH1F* RPCNoise::nDTDigisOut
private

Definition at line 126 of file RPCNoise.cc.

◆ nDTDigisOutH

TH1F* RPCNoise::nDTDigisOutH
private

Definition at line 127 of file RPCNoise.cc.

◆ nEventsAnalyzed

int RPCNoise::nEventsAnalyzed
private

Definition at line 98 of file RPCNoise.cc.

◆ nEventsSelected

int RPCNoise::nEventsSelected
private

Definition at line 99 of file RPCNoise.cc.

◆ nRPCHitsCut

int RPCNoise::nRPCHitsCut
private

Definition at line 107 of file RPCNoise.cc.

◆ nRPCRecHits

TH1F* RPCNoise::nRPCRecHits
private

Definition at line 130 of file RPCNoise.cc.

◆ nRPCRecHitsLong

TH1F* RPCNoise::nRPCRecHitsLong
private

Definition at line 131 of file RPCNoise.cc.

◆ nStrips

TH1F* RPCNoise::nStrips
private

Definition at line 117 of file RPCNoise.cc.

◆ nStripsH

TH1F* RPCNoise::nStripsH
private

Definition at line 119 of file RPCNoise.cc.

◆ nWires

TH1F* RPCNoise::nWires
private

Definition at line 116 of file RPCNoise.cc.

◆ nWiresH

TH1F* RPCNoise::nWiresH
private

Definition at line 118 of file RPCNoise.cc.

◆ orbitVsSerial

TProfile* RPCNoise::orbitVsSerial
private

Definition at line 133 of file RPCNoise.cc.

◆ RPCBX

TH1F* RPCNoise::RPCBX
private

Definition at line 136 of file RPCNoise.cc.

◆ RPCBXH

TH1F* RPCNoise::RPCBXH
private

Definition at line 138 of file RPCNoise.cc.

◆ RPCClSize

TH1F* RPCNoise::RPCClSize
private

Definition at line 137 of file RPCNoise.cc.

◆ RPCClSizeH

TH1F* RPCNoise::RPCClSizeH
private

Definition at line 139 of file RPCNoise.cc.

◆ rpcCorner

TH1F* RPCNoise::rpcCorner
private

Definition at line 151 of file RPCNoise.cc.

◆ rpcCornerH

TH1F* RPCNoise::rpcCornerH
private

Definition at line 152 of file RPCNoise.cc.

◆ rpcCornerVsOrbit

TProfile* RPCNoise::rpcCornerVsOrbit
private

Definition at line 153 of file RPCNoise.cc.

◆ rpcLayer

TH1F* RPCNoise::rpcLayer
private

Definition at line 146 of file RPCNoise.cc.

◆ rpcLayerH

TH1F* RPCNoise::rpcLayerH
private

Definition at line 147 of file RPCNoise.cc.

◆ rpcRing

TH1F* RPCNoise::rpcRing
private

Definition at line 142 of file RPCNoise.cc.

◆ rpcRingH

TH1F* RPCNoise::rpcRingH
private

Definition at line 143 of file RPCNoise.cc.

◆ rpcRingVsOrbit

TProfile* RPCNoise::rpcRingVsOrbit
private

Definition at line 150 of file RPCNoise.cc.

◆ rpcSector

TH1F* RPCNoise::rpcSector
private

Definition at line 144 of file RPCNoise.cc.

◆ rpcSectorH

TH1F* RPCNoise::rpcSectorH
private

Definition at line 145 of file RPCNoise.cc.

◆ rpcSectorVsOrbit

TProfile* RPCNoise::rpcSectorVsOrbit
private

Definition at line 149 of file RPCNoise.cc.

◆ rpcStation

TH1F* RPCNoise::rpcStation
private

Definition at line 140 of file RPCNoise.cc.

◆ rpcStationH

TH1F* RPCNoise::rpcStationH
private

Definition at line 141 of file RPCNoise.cc.

◆ rpcStationVsOrbit

TProfile* RPCNoise::rpcStationVsOrbit
private

Definition at line 148 of file RPCNoise.cc.

◆ t0All

TH1F* RPCNoise::t0All
private

Definition at line 122 of file RPCNoise.cc.

◆ t0AllH

TH1F* RPCNoise::t0AllH
private

Definition at line 123 of file RPCNoise.cc.

◆ theHistogramFile

TFile* RPCNoise::theHistogramFile
private

Definition at line 114 of file RPCNoise.cc.

◆ thisOrbit

int RPCNoise::thisOrbit
private

Definition at line 104 of file RPCNoise.cc.