#include <Validation/MuonCSCDigis/src/CSCStripDigiValidation.h>
Definition at line 9 of file CSCStripDigiValidation.h.
CSCStripDigiValidation::CSCStripDigiValidation | ( | DQMStore * | dbe, | |
const edm::InputTag & | inputTag, | |||
bool | doSim | |||
) |
Definition at line 8 of file CSCStripDigiValidation.cc.
References DQMStore::book1D(), CSCBaseValidation::dbe_, i, and theResolutionPlots.
00011 : CSCBaseValidation(dbe, inputTag), 00012 thePedestalSum(0), 00013 thePedestalCovarianceSum(0), 00014 thePedestalCount(0), 00015 theDoSimFlag(doSim), 00016 thePedestalPlot( dbe_->book1D("CSCPedestal", "CSC Pedestal ", 400, 550, 650) ), 00017 thePedestalTimeCorrelationPlot(0), 00018 thePedestalNeighborCorrelationPlot(0), 00019 theAmplitudePlot( dbe_->book1D("CSCStripAmplitude", "CSC Strip Amplitude", 200, 0, 2000) ), 00020 theRatio4to5Plot( dbe_->book1D("CSCStrip4to5", "CSC Strip Ratio tbin 4 to tbin 5", 100, 0, 1) ), 00021 theRatio6to5Plot( dbe_->book1D("CSCStrip6to5", "CSC Strip Ratio tbin 6 to tbin 5", 120, 0, 1.2) ), 00022 theNDigisPerLayerPlot( dbe_->book1D("CSCStripDigisPerLayer", "Number of CSC Strip Digis per layer", 48, 0, 48) ), 00023 theNDigisPerChamberPlot(0), 00024 theNDigisPerEventPlot( dbe_->book1D("CSCStripDigisPerEvent", "Number of CSC Strip Digis per event", 100, 0, 500) ) 00025 { 00026 if(doSim) { 00027 for(int i = 0; i < 10; ++i) 00028 { 00029 char title1[200]; 00030 sprintf(title1, "CSCStripDigiResolution%d", i+1); 00031 theResolutionPlots[i] = dbe_->book1D(title1, title1, 100, -5, 5); 00032 } 00033 } 00034 00035 }
CSCStripDigiValidation::~CSCStripDigiValidation | ( | ) |
Definition at line 38 of file CSCStripDigiValidation.cc.
00038 { 00039 /* 00040 std::cout << "RATIO for strips 4 to 5 : " << theRatio4to5Plot->getMean() << std::endl; 00041 std::cout << "RATIO for strips 6 to 5 : " << theRatio6to5Plot->getMean() << std::endl; 00042 std::cout << "NDIGIS per event : " << theNDigisPerEventPlot->getMean() << std::endl; 00043 */ 00044 }
void CSCStripDigiValidation::analyze | ( | const edm::Event & | e, | |
const edm::EventSetup & | ||||
) | [virtual] |
Implements CSCBaseValidation.
Definition at line 47 of file CSCStripDigiValidation.cc.
References detId, edm::InputTag::encode(), MonitorElement::Fill(), fillPedestalPlots(), fillSignalPlots(), edm::Event::getByLabel(), edm::Handle< T >::isValid(), j, prof2calltree::last, pedestal, DetId::rawId(), CSCBaseValidation::theInputTag, theNDigisPerEventPlot, theNDigisPerLayerPlot, thePedestalCount, and thePedestalSum.
Referenced by CSCDigiValidation::analyze().
00049 { 00050 edm::Handle<CSCStripDigiCollection> strips; 00051 e.getByLabel(theInputTag, strips); 00052 if (!strips.isValid()) { 00053 edm::LogError("CSCDigiValidation") << "Cannot get strips by label " 00054 << theInputTag.encode(); 00055 } 00056 00057 unsigned nDigisPerEvent = 0; 00058 00059 for (CSCStripDigiCollection::DigiRangeIterator j=strips->begin(); j!=strips->end(); j++) { 00060 std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first; 00061 std::vector<CSCStripDigi>::const_iterator last = (*j).second.second; 00062 int nDigis = last-digiItr; 00063 nDigisPerEvent += nDigis; 00064 theNDigisPerLayerPlot->Fill(nDigis); 00065 00066 double maxAmplitude = 0.; 00067 int maxStrip = 0; 00068 00069 for( ; digiItr != last; ++digiItr) { 00070 // average up the pedestals 00071 std::vector<int> adcCounts = digiItr->getADCCounts(); 00072 thePedestalSum += adcCounts[0]; 00073 thePedestalSum += adcCounts[1]; 00074 thePedestalCount += 2; 00075 float pedestal = thePedestalSum/thePedestalCount; 00076 if(adcCounts[4]-pedestal > maxAmplitude) 00077 { 00078 maxStrip = digiItr->getStrip(); 00079 maxAmplitude = adcCounts[4]-pedestal; 00080 } 00081 00082 // if we have enough pedestal statistics 00083 if(thePedestalCount > 100) 00084 { 00085 fillPedestalPlots(*digiItr); 00086 00087 // see if it's big enough to count as "signal" 00088 if(adcCounts[5] > (thePedestalSum/thePedestalCount + 100)) 00089 { 00090 fillSignalPlots(*digiItr); 00091 } 00092 } 00093 } 00094 int detId = (*j).first.rawId(); 00095 /* 00096 edm::PSimHitContainer simHits = theSimHitMap->hits(detId); 00097 00098 if(simHits.size() == 1) 00099 { 00100 const CSCLayer * layer = findLayer(detId); 00101 int chamberType = layer->chamber()->specs()->chamberType(); 00102 plotResolution(simHits[0], maxStrip, layer, chamberType); 00103 } 00104 */ 00105 } // loop over digis 00106 00107 theNDigisPerEventPlot->Fill(nDigisPerEvent); 00108 }
void CSCStripDigiValidation::beginJob | ( | const edm::EventSetup & | ) | [inline] |
void CSCStripDigiValidation::fillPedestalPlots | ( | const CSCStripDigi & | digi | ) | [private] |
Definition at line 111 of file CSCStripDigiValidation.cc.
References MonitorElement::Fill(), CSCStripDigi::getADCCounts(), and thePedestalPlot.
Referenced by analyze().
00112 { 00113 std::vector<int> adcCounts = digi.getADCCounts(); 00114 thePedestalPlot->Fill(adcCounts[0]); 00115 thePedestalPlot->Fill(adcCounts[1]); 00116 }
void CSCStripDigiValidation::fillSignalPlots | ( | const CSCStripDigi & | digi | ) | [private] |
Definition at line 120 of file CSCStripDigiValidation.cc.
References MonitorElement::Fill(), CSCStripDigi::getADCCounts(), pedestal, theAmplitudePlot, thePedestalCount, thePedestalSum, theRatio4to5Plot, and theRatio6to5Plot.
Referenced by analyze().
00121 { 00122 std::vector<int> adcCounts = digi.getADCCounts(); 00123 float pedestal = thePedestalSum/thePedestalCount; 00124 theAmplitudePlot->Fill(adcCounts[4] - pedestal); 00125 theRatio4to5Plot->Fill( (adcCounts[3]-pedestal) / (adcCounts[4]-pedestal) ); 00126 theRatio6to5Plot->Fill( (adcCounts[5]-pedestal) / (adcCounts[4]-pedestal) ); 00127 }
void CSCStripDigiValidation::plotResolution | ( | const PSimHit & | hit, | |
int | strip, | |||
const CSCLayer * | layer, | |||
int | chamberType | |||
) |
Definition at line 130 of file CSCStripDigiValidation.cc.
References MonitorElement::Fill(), CSCLayer::geometry(), PSimHit::localPosition(), theResolutionPlots, PV3DBase< T, PVType, FrameType >::x(), CSCLayerGeometry::xOfStrip(), and PV3DBase< T, PVType, FrameType >::y().
00132 { 00133 double hitX = hit.localPosition().x(); 00134 double hitY = hit.localPosition().y(); 00135 double digiX = layer->geometry()->xOfStrip(strip, hitY); 00136 theResolutionPlots[chamberType-1]->Fill(digiX - hitX); 00137 }
void CSCStripDigiValidation::setGeometry | ( | const CSCGeometry * | geom | ) | [inline] |
Reimplemented from CSCBaseValidation.
Definition at line 19 of file CSCStripDigiValidation.h.
References CSCBaseValidation::theCSCGeometry.
Referenced by CSCDigiValidation::analyze().
00019 {theCSCGeometry = geom;}
bool CSCStripDigiValidation::theDoSimFlag [private] |
Definition at line 31 of file CSCStripDigiValidation.h.
Definition at line 39 of file CSCStripDigiValidation.h.
int CSCStripDigiValidation::thePedestalCount [private] |
Definition at line 30 of file CSCStripDigiValidation.h.
Referenced by analyze(), and fillSignalPlots().
float CSCStripDigiValidation::thePedestalCovarianceSum [private] |
Definition at line 29 of file CSCStripDigiValidation.h.
Definition at line 34 of file CSCStripDigiValidation.h.
float CSCStripDigiValidation::thePedestalSum [private] |
Definition at line 28 of file CSCStripDigiValidation.h.
Referenced by analyze(), and fillSignalPlots().
Definition at line 33 of file CSCStripDigiValidation.h.
MonitorElement* CSCStripDigiValidation::theResolutionPlots[10] [private] |
Definition at line 41 of file CSCStripDigiValidation.h.
Referenced by CSCStripDigiValidation(), and plotResolution().