CMS 3D CMS Logo

ApvAnalysis.cc
Go to the documentation of this file.
6 #include <algorithm>
7 
8 using namespace std;
9 ApvAnalysis::ApvAnalysis(int nEvForUpdate) {
10  theTkCommonModeCalculator = nullptr;
11  theTkPedestalCalculator = nullptr;
12  theTkNoiseCalculator = nullptr;
13  theTkApvMask = nullptr;
14  nEventsForNoiseCalibration_ = 0;
15  eventsRequiredToUpdate_ = nEvForUpdate;
16 }
17 void ApvAnalysis::newEvent() const {
18  theTkPedestalCalculator->newEvent();
19  theTkNoiseCalculator->newEvent();
20  theTkCommonModeCalculator->newEvent();
21 }
22 
24  theTkPedestalCalculator->updatePedestal(in);
25 
27  if (theTkPedestalCalculator->status()->isUpdating()) {
28  nEventsForNoiseCalibration_++;
29 
30  if (theTkNoiseCalculator->noise().empty()) {
31  noise = theTkPedestalCalculator->rawNoise();
32  theTkNoiseCalculator->setStripNoise(noise);
33  theTkApvMask->calculateMask(noise);
34  }
35 
36  PedestalType pedestal = theTkPedestalCalculator->pedestal();
38  tmp.clear();
40  int i = 0;
41  for (; it != in.data.end(); it++) {
42  tmp.push_back((*it).adc() - pedestal[i]);
43  i++;
44  }
45  PedestalType tmp2 = theTkCommonModeCalculator->doIt(tmp);
46  if (!tmp2.empty()) {
47  theTkNoiseCalculator->updateNoise(tmp2);
48  }
49  if (nEventsForNoiseCalibration_ % eventsRequiredToUpdate_ == 1 && nEventsForNoiseCalibration_ > 1) {
50  noise = theTkNoiseCalculator->noise();
51  theTkApvMask->calculateMask(noise);
52  }
53  }
54 }
ApvAnalysis::ApvAnalysis
ApvAnalysis(int nev)
Definition: ApvAnalysis.cc:9
mps_fire.i
i
Definition: mps_fire.py:428
TkCommonModeCalculator.h
ApvAnalysis::newEvent
void newEvent() const
Definition: ApvAnalysis.cc:17
edm::DetSet
Definition: DetSet.h:23
ApvAnalysis.h
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
ApvAnalysis::updateCalibration
void updateCalibration(edm::DetSet< SiStripRawDigi > &in)
Definition: ApvAnalysis.cc:23
recoMuon::in
Definition: RecoMuonEnumerators.h:6
TkNoiseCalculator.h
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
gpuVertexFinder::noise
__shared__ int noise
Definition: gpuFitVertices.h:50
std
Definition: JetResolutionObject.h:76
TkPedestalCalculator.h
ApvAnalysis::PedestalType
std::vector< float > PedestalType
Definition: ApvAnalysis.h:44
TkApvMask.h
edm::DetSet::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSet.h:31