CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 RPCNoise (const edm::ParameterSet &)
 
 ~RPCNoise ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void beginJob () override
 
virtual void endJob () override
 
virtual 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::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
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 &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

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

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

Definition at line 88 of file RPCNoise.cc.

Constructor & Destructor Documentation

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

Definition at line 158 of file RPCNoise.cc.

References RPCNoise_example::fillHistograms, edm::ParameterSet::getUntrackedParameter(), RPCNoise_example::histogramFileName, RPCNoise_example::nCSCStripsCut, RPCNoise_example::nCSCWiresCut, RPCNoise_example::nDTDigisCut, RPCNoise_example::nRPCHitsCut, and AlCaHLTBitMon_QueryRunRegistry::string.

159 {
160  histogramFileName = pset.getUntrackedParameter<std::string>("histogramFileName","histos.root");
161  fillHistograms = pset.getUntrackedParameter<bool>("fillHistograms",true);
162  nRPCHitsCut = pset.getUntrackedParameter<int>("nRPCHitsCut",40);
163  nCSCStripsCut = pset.getUntrackedParameter<int>("nCSCStripsCut",50);
164  nCSCWiresCut = pset.getUntrackedParameter<int>("nCSCWiresCut",10);
165  nDTDigisCut = pset.getUntrackedParameter<int>("nDTDigisCut",10);
166 }
T getUntrackedParameter(std::string const &, T const &) const
int nRPCHitsCut
Definition: RPCNoise.cc:108
std::string histogramFileName
Definition: RPCNoise.cc:113
int nCSCStripsCut
Definition: RPCNoise.cc:109
int nCSCWiresCut
Definition: RPCNoise.cc:110
bool fillHistograms
Definition: RPCNoise.cc:107
int nDTDigisCut
Definition: RPCNoise.cc:111
RPCNoise::~RPCNoise ( )

Definition at line 167 of file RPCNoise.cc.

168 {
169 }

Member Function Documentation

void RPCNoise::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDFilter.

Definition at line 173 of file RPCNoise.cc.

References RPCNoise_example::fillHistograms, RPCNoise_example::histogramFileName, and iEvent.

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

Reimplemented from edm::EDFilter.

Definition at line 234 of file RPCNoise.cc.

References gather_cfg::cout, and RPCNoise_example::fillHistograms.

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

Implements edm::EDFilter.

Definition at line 292 of file RPCNoise.cc.

References gather_cfg::cout, RPCNoise_example::fillHistograms, iEvent, kLayer(), min(), RPCNoise_example::nCSCStripsCut, RPCNoise_example::nCSCWiresCut, RPCNoise_example::nDTDigisCut, RPCNoise_example::nRPCHitsCut, RPCDetId::region(), RPCDetId, HLT_FULL_cff::rpcRecHits, and RecoTauPiZeroBuilderPlugins_cfi::strips.

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

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

Member Data Documentation

TH1F* RPCNoise::dOrbit
private

Definition at line 136 of file RPCNoise.cc.

TH1F* RPCNoise::fDTDigisOut
private

Definition at line 129 of file RPCNoise.cc.

TH1F* RPCNoise::fDTDigisOutH
private

Definition at line 130 of file RPCNoise.cc.

bool RPCNoise::fillHistograms
private

Definition at line 107 of file RPCNoise.cc.

int RPCNoise::firstOrbit
private

Definition at line 103 of file RPCNoise.cc.

std::string RPCNoise::histogramFileName
private

Definition at line 113 of file RPCNoise.cc.

TProfile* RPCNoise::hitsVsOrbit
private

Definition at line 135 of file RPCNoise.cc.

TProfile* RPCNoise::hitsVsSerial
private

Definition at line 133 of file RPCNoise.cc.

int RPCNoise::iEvent
private

Definition at line 102 of file RPCNoise.cc.

int RPCNoise::iRun
private

Definition at line 101 of file RPCNoise.cc.

int RPCNoise::lastOrbit
private

Definition at line 104 of file RPCNoise.cc.

int RPCNoise::nCSCStripsCut
private

Definition at line 109 of file RPCNoise.cc.

int RPCNoise::nCSCWiresCut
private

Definition at line 110 of file RPCNoise.cc.

TH1F* RPCNoise::nDTDigis
private

Definition at line 121 of file RPCNoise.cc.

int RPCNoise::nDTDigisCut
private

Definition at line 111 of file RPCNoise.cc.

TH1F* RPCNoise::nDTDigisH
private

Definition at line 122 of file RPCNoise.cc.

TH1F* RPCNoise::nDTDigisIn
private

Definition at line 125 of file RPCNoise.cc.

TH1F* RPCNoise::nDTDigisInH
private

Definition at line 126 of file RPCNoise.cc.

TH1F* RPCNoise::nDTDigisOut
private

Definition at line 127 of file RPCNoise.cc.

TH1F* RPCNoise::nDTDigisOutH
private

Definition at line 128 of file RPCNoise.cc.

int RPCNoise::nEventsAnalyzed
private

Definition at line 99 of file RPCNoise.cc.

int RPCNoise::nEventsSelected
private

Definition at line 100 of file RPCNoise.cc.

int RPCNoise::nRPCHitsCut
private

Definition at line 108 of file RPCNoise.cc.

TH1F* RPCNoise::nRPCRecHits
private

Definition at line 131 of file RPCNoise.cc.

TH1F* RPCNoise::nRPCRecHitsLong
private

Definition at line 132 of file RPCNoise.cc.

TH1F* RPCNoise::nStrips
private

Definition at line 118 of file RPCNoise.cc.

TH1F* RPCNoise::nStripsH
private

Definition at line 120 of file RPCNoise.cc.

TH1F* RPCNoise::nWires
private

Definition at line 117 of file RPCNoise.cc.

TH1F* RPCNoise::nWiresH
private

Definition at line 119 of file RPCNoise.cc.

TProfile* RPCNoise::orbitVsSerial
private

Definition at line 134 of file RPCNoise.cc.

TH1F* RPCNoise::RPCBX
private

Definition at line 137 of file RPCNoise.cc.

TH1F* RPCNoise::RPCBXH
private

Definition at line 139 of file RPCNoise.cc.

TH1F* RPCNoise::RPCClSize
private

Definition at line 138 of file RPCNoise.cc.

TH1F* RPCNoise::RPCClSizeH
private

Definition at line 140 of file RPCNoise.cc.

TH1F* RPCNoise::rpcCorner
private

Definition at line 152 of file RPCNoise.cc.

TH1F* RPCNoise::rpcCornerH
private

Definition at line 153 of file RPCNoise.cc.

TProfile* RPCNoise::rpcCornerVsOrbit
private

Definition at line 154 of file RPCNoise.cc.

TH1F* RPCNoise::rpcLayer
private

Definition at line 147 of file RPCNoise.cc.

TH1F* RPCNoise::rpcLayerH
private

Definition at line 148 of file RPCNoise.cc.

TH1F* RPCNoise::rpcRing
private

Definition at line 143 of file RPCNoise.cc.

TH1F* RPCNoise::rpcRingH
private

Definition at line 144 of file RPCNoise.cc.

TProfile* RPCNoise::rpcRingVsOrbit
private

Definition at line 151 of file RPCNoise.cc.

TH1F* RPCNoise::rpcSector
private

Definition at line 145 of file RPCNoise.cc.

TH1F* RPCNoise::rpcSectorH
private

Definition at line 146 of file RPCNoise.cc.

TProfile* RPCNoise::rpcSectorVsOrbit
private

Definition at line 150 of file RPCNoise.cc.

TH1F* RPCNoise::rpcStation
private

Definition at line 141 of file RPCNoise.cc.

TH1F* RPCNoise::rpcStationH
private

Definition at line 142 of file RPCNoise.cc.

TProfile* RPCNoise::rpcStationVsOrbit
private

Definition at line 149 of file RPCNoise.cc.

TH1F* RPCNoise::t0All
private

Definition at line 123 of file RPCNoise.cc.

TH1F* RPCNoise::t0AllH
private

Definition at line 124 of file RPCNoise.cc.

TFile* RPCNoise::theHistogramFile
private

Definition at line 115 of file RPCNoise.cc.

int RPCNoise::thisOrbit
private

Definition at line 105 of file RPCNoise.cc.