CMS 3D CMS Logo

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

#include <CSCComparatorDigiValidation.h>

Inheritance diagram for CSCComparatorDigiValidation:
CSCBaseValidation

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &)
 
 CSCComparatorDigiValidation (const edm::ParameterSet &ps, edm::ConsumesCollector &&iC)
 
void plotResolution (const PSimHit &hit, int strip, const CSCLayer *layer, int chamberType)
 
 ~CSCComparatorDigiValidation () override
 
- Public Member Functions inherited from CSCBaseValidation
 CSCBaseValidation (const edm::ParameterSet &ps)
 
void setGeometry (const CSCGeometry *geom)
 
void setSimHitMap (const PSimHitMap *simHitMap)
 
virtual ~CSCBaseValidation ()
 

Private Attributes

edm::EDGetTokenT< CSCComparatorDigiCollectioncomparators_Token_
 
edm::InputTag inputTagComp_
 
edm::InputTag inputTagStrip_
 
edm::EDGetTokenT< CSCStripDigiCollectionstrips_Token_
 
MonitorElementthe3StripPlots [10]
 
MonitorElementtheNDigisPerEventPlot
 
MonitorElementtheNDigisPerLayerPlots [10]
 
MonitorElementtheResolutionPlots [10]
 
MonitorElementtheStripDigiPlots [10]
 
MonitorElementtheTimeBinPlots [10]
 

Additional Inherited Members

- Public Types inherited from CSCBaseValidation
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from CSCBaseValidation
const CSCLayerfindLayer (int detId) const
 
bool isSimTrackGood (const SimTrack &t) const
 
- Protected Attributes inherited from CSCBaseValidation
bool doSim_
 
double simTrackMaxEta_
 
double simTrackMinEta_
 
double simTrackMinPt_
 
const CSCGeometrytheCSCGeometry
 
const PSimHitMaptheSimHitMap
 

Detailed Description

Definition at line 12 of file CSCComparatorDigiValidation.h.

Constructor & Destructor Documentation

◆ CSCComparatorDigiValidation()

CSCComparatorDigiValidation::CSCComparatorDigiValidation ( const edm::ParameterSet ps,
edm::ConsumesCollector &&  iC 
)

Definition at line 7 of file CSCComparatorDigiValidation.cc.

References comparators_Token_, edm::ParameterSet::getParameterSet(), inputTagComp_, inputTagStrip_, DigiDM_cff::strips, and strips_Token_.

9  const auto &comps = ps.getParameterSet("cscComparatorDigi");
10  inputTagComp_ = comps.getParameter<edm::InputTag>("inputTag");
12 
13  const auto &strips = ps.getParameterSet("cscStripDigi");
14  inputTagStrip_ = strips.getParameter<edm::InputTag>("inputTag");
16 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< CSCComparatorDigiCollection > comparators_Token_
CSCBaseValidation(const edm::ParameterSet &ps)
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
edm::EDGetTokenT< CSCStripDigiCollection > strips_Token_

◆ ~CSCComparatorDigiValidation()

CSCComparatorDigiValidation::~CSCComparatorDigiValidation ( )
override

Definition at line 18 of file CSCComparatorDigiValidation.cc.

18 {}

Member Function Documentation

◆ analyze()

void CSCComparatorDigiValidation::analyze ( const edm::Event e,
const edm::EventSetup  
)
overridevirtual

Implements CSCBaseValidation.

Definition at line 65 of file CSCComparatorDigiValidation.cc.

References gpuClustering::adc, comparators_Token_, CSCBaseValidation::doSim_, MillePedeFileConverter_cfg::e, edm::InputTag::encode(), dqm::impl::MonitorElement::Fill(), CSCBaseValidation::findLayer(), PSimHitMap::hits(), inputTagComp_, edm::HandleBase::isValid(), dqmiolumiharvest::j, dqmdumpme::last, pixelTopology::layer, CSCConstants::NUM_STRIPS_PER_CFEB, plotResolution(), DetId::rawId(), FastTrackerRecHitCombiner_cfi::simHits, digitizers_cfi::strip, strips_Token_, the3StripPlots, theNDigisPerEventPlot, theNDigisPerLayerPlots, CSCBaseValidation::theSimHitMap, theStripDigiPlots, and theTimeBinPlots.

65  {
68 
69  e.getByToken(comparators_Token_, comparators);
70  if (!comparators.isValid()) {
71  edm::LogError("CSCComparatorDigiValidation") << "Cannot get comparators by label " << inputTagComp_.encode();
72  }
73  e.getByToken(strips_Token_, stripDigis);
74  if (!stripDigis.isValid()) {
75  edm::LogError("CSCComparatorDigiValidation") << "Cannot get strips by label " << inputTagComp_.encode();
76  }
77 
78  unsigned nDigisPerEvent = 0;
79 
80  for (auto j = comparators->begin(); j != comparators->end(); j++) {
81  auto digiItr = (*j).second.first;
82  auto last = (*j).second.second;
83 
84  CSCDetId detId((*j).first);
85  const CSCLayer *layer = findLayer(detId.rawId());
86  int chamberType = layer->chamber()->specs()->chamberType();
87  int nDigis = last - digiItr;
88 
89  theNDigisPerLayerPlots[chamberType - 1]->Fill(last - digiItr);
90 
91  // require exactly one comparator digi per layer
92  if (doSim_) {
94  if (nDigis == 1 && simHits.size() == 1) {
95  const int fullStrip(digiItr->getStrip() + digiItr->getCFEB() * CSCConstants::NUM_STRIPS_PER_CFEB);
96  plotResolution(simHits[0], fullStrip, layer, chamberType);
97  }
98  }
99 
100  for (auto stripRange = stripDigis->get(detId); digiItr != last; ++digiItr) {
101  ++nDigisPerEvent;
102  theTimeBinPlots[chamberType - 1]->Fill(digiItr->getTimeBin());
103 
104  int strip = digiItr->getStrip();
105  for (auto stripItr = stripRange.first; stripItr != stripRange.second; ++stripItr) {
106  if (stripItr->getStrip() == strip) {
107  std::vector<int> adc = stripItr->getADCCounts();
108  float pedc = 0.5 * (adc[0] + adc[1]);
109  float amp = adc[4] - pedc;
110  theStripDigiPlots[chamberType - 1]->Fill(amp);
111  // check neighbors
112  if (stripItr != stripRange.first && stripItr != stripRange.second - 1) {
113  std::vector<int> adcl = (stripItr - 1)->getADCCounts();
114  std::vector<int> adcr = (stripItr + 1)->getADCCounts();
115  float pedl = 0.5 * (adcl[0] + adcl[1]);
116  float pedr = 0.5 * (adcr[0] + adcr[1]);
117  float three = adcl[4] - pedl + adcr[4] - pedr + amp;
118  the3StripPlots[chamberType - 1]->Fill(three);
119  }
120  }
121  }
122  }
123  }
124  theNDigisPerEventPlot->Fill(nDigisPerEvent);
125 }
std::string encode() const
Definition: InputTag.cc:159
Log< level::Error, false > LogError
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
void Fill(long long x)
void plotResolution(const PSimHit &hit, int strip, const CSCLayer *layer, int chamberType)
edm::EDGetTokenT< CSCComparatorDigiCollection > comparators_Token_
const PSimHitMap * theSimHitMap
const CSCLayer * findLayer(int detId) const
const edm::PSimHitContainer & hits(int detId) const
Definition: PSimHitMap.cc:20
bool isValid() const
Definition: HandleBase.h:70
std::vector< PSimHit > PSimHitContainer
edm::EDGetTokenT< CSCStripDigiCollection > strips_Token_
uint16_t *__restrict__ uint16_t const *__restrict__ adc

◆ bookHistograms()

void CSCComparatorDigiValidation::bookHistograms ( DQMStore::IBooker iBooker)

Definition at line 20 of file CSCComparatorDigiValidation.cc.

References dqm::implementation::IBooker::book1D(), CSCDetId::chamberName(), CSCBaseValidation::doSim_, mps_fire::i, dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, RandomServiceHelper::t1, RandomServiceHelper::t2, RandomServiceHelper::t3, the3StripPlots, theNDigisPerEventPlot, theNDigisPerLayerPlots, theResolutionPlots, theStripDigiPlots, and theTimeBinPlots.

20  {
21  iBooker.setCurrentFolder("MuonCSCDigisV/CSCDigiTask/Comparator/Occupancy/");
22 
23  theNDigisPerEventPlot = iBooker.book1D("CSCComparatorDigisPerEvent",
24  "CSC Comparator Digis per event;CSC Comparator Digis per event;Entries",
25  100,
26  0,
27  100);
28  // 10 chamber types, if you consider ME1/a and ME1/b separate
29  for (int i = 1; i <= 10; ++i) {
30  const std::string t1("CSCComparatorDigiTime_" + CSCDetId::chamberName(i));
31  const std::string t2("CSCComparatorDigisPerLayer_" + CSCDetId::chamberName(i));
32  const std::string t3("CSCComparatorStripAmplitude_" + CSCDetId::chamberName(i));
33  const std::string t4("CSCComparator3StripAmplitude_" + CSCDetId::chamberName(i));
34  theTimeBinPlots[i - 1] = iBooker.book1D(
35  t1, "Comparator Time Bin " + CSCDetId::chamberName(i) + " ;Comparator Time Bin; Entries", 16, 0, 16);
36  theNDigisPerLayerPlots[i - 1] = iBooker.book1D(
37  t2,
38  "Number of Comparator Digis " + CSCDetId::chamberName(i) + " ;Number of Comparator Digis; Entries",
39  100,
40  0,
41  20);
42  theStripDigiPlots[i - 1] = iBooker.book1D(
43  t3, "Comparator Amplitude " + CSCDetId::chamberName(i) + " ;Comparator Amplitude; Entries", 100, 0, 1000);
44  the3StripPlots[i - 1] = iBooker.book1D(
45  t4,
46  "Comparator-triplet Amplitude " + CSCDetId::chamberName(i) + " ;Comparator-triplet Amplitude; Entries",
47  100,
48  0,
49  1000);
50  }
51  if (doSim_) {
52  iBooker.setCurrentFolder("MuonCSCDigisV/CSCDigiTask/Comparator/Resolution/");
53  for (int i = 1; i <= 10; ++i) {
54  const std::string t1("CSCComparatorPosResolution_" + CSCDetId::chamberName(i));
55  theResolutionPlots[i - 1] = iBooker.book1D(t1,
56  "Comparator X Position Resolution " + CSCDetId::chamberName(i) +
57  ";Comparator X Position Resolution [cm]; Entries",
58  100,
59  -5,
60  5);
61  }
62  }
63 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::string chamberName() const
Definition: CSCDetId.cc:92
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ plotResolution()

void CSCComparatorDigiValidation::plotResolution ( const PSimHit hit,
int  strip,
const CSCLayer layer,
int  chamberType 
)

Definition at line 127 of file CSCComparatorDigiValidation.cc.

References dqm::impl::MonitorElement::Fill(), pixelTopology::layer, digitizers_cfi::strip, theResolutionPlots, hit::x, and hit::y.

Referenced by analyze().

127  {
128  double hitX = hit.localPosition().x();
129  double hitY = hit.localPosition().y();
130  double digiX = layer->geometry()->xOfStrip(strip, hitY);
131  theResolutionPlots[chamberType - 1]->Fill(digiX - hitX);
132 }
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
void Fill(long long x)

Member Data Documentation

◆ comparators_Token_

edm::EDGetTokenT<CSCComparatorDigiCollection> CSCComparatorDigiValidation::comparators_Token_
private

Definition at line 22 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and CSCComparatorDigiValidation().

◆ inputTagComp_

edm::InputTag CSCComparatorDigiValidation::inputTagComp_
private

Definition at line 24 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and CSCComparatorDigiValidation().

◆ inputTagStrip_

edm::InputTag CSCComparatorDigiValidation::inputTagStrip_
private

Definition at line 23 of file CSCComparatorDigiValidation.h.

Referenced by CSCComparatorDigiValidation().

◆ strips_Token_

edm::EDGetTokenT<CSCStripDigiCollection> CSCComparatorDigiValidation::strips_Token_
private

Definition at line 21 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and CSCComparatorDigiValidation().

◆ the3StripPlots

MonitorElement* CSCComparatorDigiValidation::the3StripPlots[10]
private

Definition at line 29 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theNDigisPerEventPlot

MonitorElement* CSCComparatorDigiValidation::theNDigisPerEventPlot
private

Definition at line 30 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theNDigisPerLayerPlots

MonitorElement* CSCComparatorDigiValidation::theNDigisPerLayerPlots[10]
private

Definition at line 27 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theResolutionPlots

MonitorElement* CSCComparatorDigiValidation::theResolutionPlots[10]
private

Definition at line 31 of file CSCComparatorDigiValidation.h.

Referenced by bookHistograms(), and plotResolution().

◆ theStripDigiPlots

MonitorElement* CSCComparatorDigiValidation::theStripDigiPlots[10]
private

Definition at line 28 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().

◆ theTimeBinPlots

MonitorElement* CSCComparatorDigiValidation::theTimeBinPlots[10]
private

Definition at line 26 of file CSCComparatorDigiValidation.h.

Referenced by analyze(), and bookHistograms().