CMS 3D CMS Logo

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

#include <ApvAnalysisFactory.h>

Public Types

typedef std::map< uint32_t, ApvAnalysisVectorApvAnalysisMap
 
typedef std::vector< ApvAnalysis * > ApvAnalysisVector
 
typedef std::map< ApvAnalysis *, uint32_t > InverseMap
 
typedef std::map< ApvAnalysis *, int > MapNumberingPosition
 

Public Member Functions

 ApvAnalysisFactory (std::string theAlgorithmType, int theNumCMstripsInGroup, int theMaskCalcFlag, float theMaskNoiseCut, float theMaskDeadCut, float theMaskTruncCut, float theCutToAvoidSignal, int theEventInitNumber, int theEventIterNumber)
 
 ApvAnalysisFactory (const edm::ParameterSet &pset)
 
ApvAnalysisVector getApvAnalysis (const uint32_t nDET_ID)
 
void getCommonMode (uint32_t det_id, ApvAnalysis::PedestalType &tmp)
 
std::vector< float > getCommonMode (uint32_t det_id, int apvNumber)
 
void getCommonModeSlope (uint32_t det_id, ApvAnalysis::PedestalType &tmp)
 
float getCommonModeSlope (uint32_t det_id, int apvNumber)
 
void getMask (uint32_t det_id, TkApvMask::MaskType &tmp)
 
void getNoise (uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &noise)
 
void getNoise (uint32_t det_id, ApvAnalysis::PedestalType &noise)
 
void getPedestal (uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &peds)
 
void getPedestal (uint32_t det_id, ApvAnalysis::PedestalType &peds)
 
void getRawNoise (uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &noise)
 
void getRawNoise (uint32_t det_id, ApvAnalysis::PedestalType &noise)
 
std::string getStatus (uint32_t det_id)
 
float getStripNoise (uint32_t det_id, int stripNumber)
 
float getStripPedestal (uint32_t det_id, int stripNumber)
 
float getStripRawNoise (uint32_t det_id, int stripNumber)
 
bool instantiateApvs (uint32_t det_id, int numberOfApvs)
 
bool isUpdating (uint32_t detId)
 
void update (uint32_t det_id, const edm::DetSet< SiStripRawDigi > &in)
 
void updatePair (uint32_t det_id, size_t apvPair, const edm::DetSet< SiStripRawDigi > &in)
 
 ~ApvAnalysisFactory ()
 

Private Member Functions

void constructAuxiliaryApvClasses (ApvAnalysis *theApv, uint32_t det_id, int thisApv)
 
void deleteApv (ApvAnalysis *apv)
 

Private Attributes

ApvAnalysisMap apvMap_
 
std::string theAlgorithmType_
 
std::string theCMType_
 
float theCutToAvoidSignal_
 
int theEventInitNumber_
 
int theEventIterNumber_
 
int theMaskCalcFlag_
 
float theMaskDeadCut_
 
float theMaskNoiseCut_
 
float theMaskTruncCut_
 
int theNumCMstripsInGroup_
 
bool useDB_
 

Detailed Description

Definition at line 22 of file ApvAnalysisFactory.h.

Member Typedef Documentation

◆ ApvAnalysisMap

Definition at line 68 of file ApvAnalysisFactory.h.

◆ ApvAnalysisVector

Definition at line 24 of file ApvAnalysisFactory.h.

◆ InverseMap

typedef std::map<ApvAnalysis*, uint32_t> ApvAnalysisFactory::InverseMap

Definition at line 70 of file ApvAnalysisFactory.h.

◆ MapNumberingPosition

Definition at line 69 of file ApvAnalysisFactory.h.

Constructor & Destructor Documentation

◆ ApvAnalysisFactory() [1/2]

ApvAnalysisFactory::ApvAnalysisFactory ( std::string  theAlgorithmType,
int  theNumCMstripsInGroup,
int  theMaskCalcFlag,
float  theMaskNoiseCut,
float  theMaskDeadCut,
float  theMaskTruncCut,
float  theCutToAvoidSignal,
int  theEventInitNumber,
int  theEventIterNumber 
)

◆ ApvAnalysisFactory() [2/2]

ApvAnalysisFactory::ApvAnalysisFactory ( const edm::ParameterSet pset)

Definition at line 27 of file ApvAnalysisFactory.cc.

References muonDTDigis_cfi::pset.

27  {
28  theCMType_ = pset.getParameter<string>("CMType");
29  useDB_ = pset.getParameter<bool>("useDB");
30 
31  theAlgorithmType_ = pset.getParameter<string>("CalculatorAlgorithm");
32  theNumCMstripsInGroup_ = pset.getParameter<int>("NumCMstripsInGroup");
33  theMaskCalcFlag_ = pset.getParameter<int>("MaskCalculationFlag");
34 
35  theMaskNoiseCut_ = pset.getParameter<double>("MaskNoiseCut");
36  theMaskDeadCut_ = pset.getParameter<double>("MaskDeadCut");
37  theMaskTruncCut_ = pset.getParameter<double>("MaskTruncationCut");
38  theCutToAvoidSignal_ = pset.getParameter<double>("CutToAvoidSignal");
39 
40  theEventInitNumber_ = pset.getParameter<int>("NumberOfEventsForInit");
41  theEventIterNumber_ = pset.getParameter<int>("NumberOfEventsForIteration");
42  apvMap_.clear();
43 }
ApvAnalysisMap apvMap_
std::string theAlgorithmType_

◆ ~ApvAnalysisFactory()

ApvAnalysisFactory::~ApvAnalysisFactory ( )

Definition at line 45 of file ApvAnalysisFactory.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

45  {
46  ApvAnalysisFactory::ApvAnalysisMap::iterator it = apvMap_.begin();
47  for (; it != apvMap_.end(); it++) {
48  vector<ApvAnalysis*>::iterator myApv = (*it).second.begin();
49  for (; myApv != (*it).second.end(); myApv++)
50  deleteApv(*myApv);
51  }
52  apvMap_.clear();
53 }
ApvAnalysisMap apvMap_
void deleteApv(ApvAnalysis *apv)

Member Function Documentation

◆ constructAuxiliaryApvClasses()

void ApvAnalysisFactory::constructAuxiliaryApvClasses ( ApvAnalysis theApv,
uint32_t  det_id,
int  thisApv 
)
private

Definition at line 81 of file ApvAnalysisFactory.cc.

References gather_cfg::cout, TkCommonModeCalculator::setCM(), ApvAnalysis::setCommonModeCalculator(), ApvAnalysis::setMask(), ApvAnalysis::setNoiseCalculator(), ApvAnalysis::setPedestalCalculator(), and TkCommonMode::setTopology().

81  {
82  //----------------------------------------------------------------
83  // Create the ped/noise/CMN calculators, zero suppressors etc.
84  // (Is called by addDetUnitAndConstructApvs()).
85  //
86  // N.B. Don't call this twice for the same APV!
87  //-----------------------------------------------------------------
88  // cout<<"VirtualApvAnalysisFactory::constructAuxiliaryApvClasses"<<endl;
89  TkPedestalCalculator* thePedestal = nullptr;
90  TkNoiseCalculator* theNoise = nullptr;
91  TkApvMask* theMask = nullptr;
92  TkCommonModeCalculator* theCM = nullptr;
93 
94  TkCommonMode* theCommonMode = new TkCommonMode();
96  theCommonMode->setTopology(theTopology);
97 
98  // Create desired algorithms.
99  if (theAlgorithmType_ == "TT6") {
103  theCM = new TT6CommonModeCalculator(theNoise, theMask, theCutToAvoidSignal_);
104  } else if ("TT6NT" == theAlgorithmType_) {
107  thePedestal = new TT6NTPedestalCalculator;
108  theCM = new TT6CommonModeCalculator(theNoise, theMask, theCutToAvoidSignal_);
109  } else if (theAlgorithmType_ == "MIX") {
110  // the mask as to be defined also for SimplePedCalculator
112 
114 
116 
117  if (theCMType_ == "Median") {
118  theCM = new MedianCommonModeCalculator();
119  } else {
120  cout << "Sorry Only Median is available for now, Mean and FastLinear are coming soon" << endl;
121  delete theCommonMode;
122  delete theMask;
123  delete thePedestal;
124  delete theNoise;
125  return;
126  }
127  } else {
128  cout << "ApvAnalysisFactory: algorithm " << theAlgorithmType_ << " not supported" << endl;
129  delete theCommonMode;
130  return;
131  }
132 
133  if (theCommonMode)
134  theCM->setCM(theCommonMode);
135  if (thePedestal)
136  theAPV->setPedestalCalculator(*thePedestal);
137  if (theNoise)
138  theAPV->setNoiseCalculator(*theNoise);
139  if (theMask)
140  theAPV->setMask(*theMask);
141  if (theCM)
142  theAPV->setCommonModeCalculator(*theCM);
143 }
virtual void setCM(TkCommonMode *)=0
virtual void setTopology(TkCommonModeTopology *in)
Definition: TkCommonMode.h:18
std::string theAlgorithmType_

◆ deleteApv()

void ApvAnalysisFactory::deleteApv ( ApvAnalysis apv)
private

Definition at line 362 of file ApvAnalysisFactory.cc.

References TkCommonModeCalculator::commonMode(), ApvAnalysis::commonModeCalculator(), ApvAnalysis::mask(), ApvAnalysis::noiseCalculator(), ApvAnalysis::pedestalCalculator(), and TkCommonMode::topology().

362  {
363  delete &(apv->pedestalCalculator());
364  delete &(apv->noiseCalculator());
365  delete &(apv->mask());
366  delete &(apv->commonModeCalculator().commonMode()->topology());
367  delete (apv->commonModeCalculator().commonMode());
368  delete &(apv->commonModeCalculator());
369  delete apv;
370 }
TkCommonModeCalculator & commonModeCalculator()
Definition: ApvAnalysis.h:58
virtual TkCommonMode * commonMode()=0
TkPedestalCalculator & pedestalCalculator()
Definition: ApvAnalysis.h:59
virtual TkCommonModeTopology & topology()
Definition: TkCommonMode.h:17
TkApvMask & mask()
Definition: ApvAnalysis.h:61
TkNoiseCalculator & noiseCalculator()
Definition: ApvAnalysis.h:60

◆ getApvAnalysis()

std::vector< ApvAnalysis * > ApvAnalysisFactory::getApvAnalysis ( const uint32_t  nDET_ID)

Definition at line 75 of file ApvAnalysisFactory.cc.

Referenced by NoiseTask::book().

75  {
76  ApvAnalysisMap::const_iterator _apvAnalysisIter = apvMap_.find(nDET_ID);
77 
78  return apvMap_.end() != _apvAnalysisIter ? _apvAnalysisIter->second : std::vector<ApvAnalysis*>();
79 }
ApvAnalysisMap apvMap_

◆ getCommonMode() [1/2]

void ApvAnalysisFactory::getCommonMode ( uint32_t  det_id,
ApvAnalysis::PedestalType tmp 
)

Definition at line 320 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId, mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and createJobs::tmp.

Referenced by SiStripMonitorPedestals::analyze(), and NoiseTask::update().

320  {
321  map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
322  if (apvAnalysisIt != apvMap_.end()) {
323  vector<ApvAnalysis*> theApvs = apvAnalysisIt->second;
324  for (unsigned int i = 0; i < theApvs.size(); i++) {
325  //To be fixed. We return only the first one in the vector.
326  vector<float> tmp_cm = theApvs[i]->commonModeCalculator().commonMode()->returnAsVector();
327  for (unsigned int it = 0; it < tmp_cm.size(); it++)
328  tmp.push_back(tmp_cm[it]);
329  }
330  }
331 }
ApvAnalysisMap apvMap_
tmp
align.sh
Definition: createJobs.py:716

◆ getCommonMode() [2/2]

vector< float > ApvAnalysisFactory::getCommonMode ( uint32_t  det_id,
int  apvNumber 
)

Definition at line 309 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId, and createJobs::tmp.

309  {
310  vector<float> tmp;
311  tmp.clear();
312  map<uint32_t, vector<ApvAnalysis*> >::const_iterator theApvs_map = apvMap_.find(detId);
313  if (theApvs_map != apvMap_.end()) {
314  vector<ApvAnalysis*> theApvs = theApvs_map->second;
315 
316  tmp = theApvs[apvNumber]->commonModeCalculator().commonMode()->returnAsVector();
317  }
318  return tmp;
319 }
ApvAnalysisMap apvMap_
tmp
align.sh
Definition: createJobs.py:716

◆ getCommonModeSlope() [1/2]

void ApvAnalysisFactory::getCommonModeSlope ( uint32_t  det_id,
ApvAnalysis::PedestalType tmp 
)

Definition at line 384 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId, mps_fire::i, and createJobs::tmp.

Referenced by SiStripMonitorPedestals::analyze().

384  {
385  tmp.clear();
386  map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
387  if (apvAnalysisIt != apvMap_.end()) {
388  vector<ApvAnalysis*> theApvs = apvAnalysisIt->second;
389  for (unsigned int i = 0; i < theApvs.size(); i++) {
390  tmp.push_back(theApvs[i]->commonModeCalculator().getCMSlope());
391  }
392  }
393 }
ApvAnalysisMap apvMap_
tmp
align.sh
Definition: createJobs.py:716

◆ getCommonModeSlope() [2/2]

float ApvAnalysisFactory::getCommonModeSlope ( uint32_t  det_id,
int  apvNumber 
)

Definition at line 374 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId, and createJobs::tmp.

374  {
375  map<uint32_t, vector<ApvAnalysis*> >::const_iterator theApvs_map = apvMap_.find(detId);
376  float tmp = -100.0;
377  if (theApvs_map != apvMap_.end()) {
378  vector<ApvAnalysis*> theApvs = theApvs_map->second;
379  tmp = theApvs[apvNumber]->commonModeCalculator().getCMSlope();
380  return tmp;
381  }
382  return tmp;
383 }
ApvAnalysisMap apvMap_
tmp
align.sh
Definition: createJobs.py:716

◆ getMask()

void ApvAnalysisFactory::getMask ( uint32_t  det_id,
TkApvMask::MaskType tmp 
)

Definition at line 333 of file ApvAnalysisFactory.cc.

References mps_fire::i, cuy::ii, ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, and createJobs::tmp.

Referenced by SiStripMonitorPedestals::analyze().

333  {
334  map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(det_id);
335  if (apvAnalysisIt != apvMap_.end()) {
336  vector<ApvAnalysis*> theApvs = apvAnalysisIt->second;
337  for (unsigned int i = 0; i < theApvs.size(); i++) {
338  TkApvMask::MaskType theMaskType = (theApvs[i]->mask()).mask();
339  //cout <<"theMaskType size "<<theMaskType.size()<<endl;
340 
341  for (unsigned int ii = 0; ii < theMaskType.size(); ii++) {
342  tmp.push_back(theMaskType[ii]);
343  //cout <<"The Value "<<theMaskType[ii]<<" "<<ii<<endl;
344  }
345  }
346  }
347 }
std::vector< StripMaskType > MaskType
Definition: TkApvMask.h:15
ApvAnalysisMap apvMap_
ii
Definition: cuy.py:589
tmp
align.sh
Definition: createJobs.py:716

◆ getNoise() [1/2]

void ApvAnalysisFactory::getNoise ( uint32_t  det_id,
int  apvNumber,
ApvAnalysis::PedestalType noise 
)

Definition at line 239 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId, and hgchebackDigitizer_cfi::noise.

Referenced by SiStripMonitorPedestals::analyze(), and NoiseTask::update().

239  {
240  //Get the pedestal for a given apv
241  noise.clear();
242  map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
243  if (apvAnalysisIt != apvMap_.end()) {
244  vector<ApvAnalysis*> theApvs = apvAnalysisIt->second;
245 
246  noise = theApvs[apvNumber]->noiseCalculator().noise();
247  }
248 }
ApvAnalysisMap apvMap_

◆ getNoise() [2/2]

void ApvAnalysisFactory::getNoise ( uint32_t  det_id,
ApvAnalysis::PedestalType noise 
)

Definition at line 260 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId, and createJobs::tmp.

260  {
261  //Get the pedestal for a given apv
262  peds.clear();
263  map<uint32_t, vector<ApvAnalysis*> >::const_iterator theApvs_map = apvMap_.find(detId);
264  if (theApvs_map != apvMap_.end()) {
265  vector<ApvAnalysis*>::const_iterator theApvs = (theApvs_map->second).begin();
266  for (; theApvs != (theApvs_map->second).end(); theApvs++) {
267  ApvAnalysis::PedestalType tmp = (*theApvs)->noiseCalculator().noise();
268  for (ApvAnalysis::PedestalType::const_iterator pit = tmp.begin(); pit != tmp.end(); pit++)
269  peds.push_back(*pit);
270  }
271  }
272 }
std::vector< float > PedestalType
Definition: ApvAnalysis.h:44
ApvAnalysisMap apvMap_
tmp
align.sh
Definition: createJobs.py:716

◆ getPedestal() [1/2]

void ApvAnalysisFactory::getPedestal ( uint32_t  det_id,
int  apvNumber,
ApvAnalysis::PedestalType peds 
)

Definition at line 207 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId.

Referenced by SiStripMonitorPedestals::analyze(), PedsOnlyTask::update(), and NoiseTask::update().

207  {
208  //Get the pedestal for a given apv
209  peds.clear();
210  map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
211  if (apvAnalysisIt != apvMap_.end()) {
212  vector<ApvAnalysis*> myApvs = apvAnalysisIt->second;
213  peds = myApvs[apvNumber]->pedestalCalculator().pedestal();
214  }
215 }
ApvAnalysisMap apvMap_

◆ getPedestal() [2/2]

void ApvAnalysisFactory::getPedestal ( uint32_t  det_id,
ApvAnalysis::PedestalType peds 
)

Definition at line 217 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, and createJobs::tmp.

217  {
218  //Get the pedestal for a given apv
219  peds.clear();
220  map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
221  if (apvAnalysisIt != apvMap_.end()) {
222  vector<ApvAnalysis*> theApvs = apvAnalysisIt->second;
223  for (vector<ApvAnalysis*>::const_iterator it = theApvs.begin(); it != theApvs.end(); it++) {
224  ApvAnalysis::PedestalType tmp = (*it)->pedestalCalculator().pedestal();
225  for (ApvAnalysis::PedestalType::const_iterator pit = tmp.begin(); pit != tmp.end(); pit++)
226  peds.push_back(*pit);
227  }
228  }
229 }
std::vector< float > PedestalType
Definition: ApvAnalysis.h:44
ApvAnalysisMap apvMap_
tmp
align.sh
Definition: createJobs.py:716

◆ getRawNoise() [1/2]

void ApvAnalysisFactory::getRawNoise ( uint32_t  det_id,
int  apvNumber,
ApvAnalysis::PedestalType noise 
)

Definition at line 274 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId, and hgchebackDigitizer_cfi::noise.

Referenced by SiStripMonitorPedestals::analyze(), and PedsOnlyTask::update().

274  {
275  //Get the pedestal for a given apv
276  noise.clear();
277  map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
278  if (apvAnalysisIt != apvMap_.end()) {
279  vector<ApvAnalysis*> theApvs = apvAnalysisIt->second;
280 
281  noise = theApvs[apvNumber]->pedestalCalculator().rawNoise();
282  }
283 }
ApvAnalysisMap apvMap_

◆ getRawNoise() [2/2]

void ApvAnalysisFactory::getRawNoise ( uint32_t  det_id,
ApvAnalysis::PedestalType noise 
)

Definition at line 295 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId, and createJobs::tmp.

295  {
296  //Get the pedestal for a given apv
297  peds.clear();
298  map<uint32_t, vector<ApvAnalysis*> >::const_iterator theApvs_map = apvMap_.find(detId);
299  if (theApvs_map != apvMap_.end()) {
300  vector<ApvAnalysis*>::const_iterator theApvs = (theApvs_map->second).begin();
301  for (; theApvs != (theApvs_map->second).end(); theApvs++) {
302  ApvAnalysis::PedestalType tmp = (*theApvs)->pedestalCalculator().rawNoise();
303  for (ApvAnalysis::PedestalType::const_iterator pit = tmp.begin(); pit != tmp.end(); pit++)
304  peds.push_back(*pit);
305  }
306  }
307 }
std::vector< float > PedestalType
Definition: ApvAnalysis.h:44
ApvAnalysisMap apvMap_
tmp
align.sh
Definition: createJobs.py:716

◆ getStatus()

std::string ApvAnalysisFactory::getStatus ( uint32_t  det_id)

◆ getStripNoise()

float ApvAnalysisFactory::getStripNoise ( uint32_t  det_id,
int  stripNumber 
)

Definition at line 250 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId, createfilelist::int, and groupFilesInBlocks::temp.

250  {
251  //Get the pedestal for a given apv
253  int apvNumb = int(stripNumber / 128.);
254  int stripN = (stripNumber - apvNumb * 128);
255 
256  getNoise(detId, apvNumb, temp);
257  return temp[stripN];
258 }
std::vector< float > PedestalType
Definition: ApvAnalysis.h:44
void getNoise(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &noise)

◆ getStripPedestal()

float ApvAnalysisFactory::getStripPedestal ( uint32_t  det_id,
int  stripNumber 
)

Definition at line 230 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId, createfilelist::int, and groupFilesInBlocks::temp.

230  {
231  //Get the pedestal for a given apv
233  int apvNumb = int(stripNumber / 128.);
234  int stripN = (stripNumber - apvNumb * 128);
235 
236  getPedestal(detId, apvNumb, temp);
237  return temp[stripN];
238 }
std::vector< float > PedestalType
Definition: ApvAnalysis.h:44
void getPedestal(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &peds)

◆ getStripRawNoise()

float ApvAnalysisFactory::getStripRawNoise ( uint32_t  det_id,
int  stripNumber 
)

Definition at line 285 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId, createfilelist::int, and groupFilesInBlocks::temp.

285  {
286  //Get the pedestal for a given apv
288  int apvNumb = int(stripNumber / 128.);
289  int stripN = (stripNumber - apvNumb * 128);
290 
291  getRawNoise(detId, apvNumb, temp);
292  return temp[stripN];
293 }
std::vector< float > PedestalType
Definition: ApvAnalysis.h:44
void getRawNoise(uint32_t det_id, int apvNumber, ApvAnalysis::PedestalType &noise)

◆ instantiateApvs()

bool ApvAnalysisFactory::instantiateApvs ( uint32_t  det_id,
int  numberOfApvs 
)

Definition at line 57 of file ApvAnalysisFactory.cc.

References gather_cfg::cout, hcalRecHitTable_cff::detId, mps_fire::i, and groupFilesInBlocks::temp.

Referenced by PedsOnlyTask::book(), NoiseTask::book(), and SiStripMonitorPedestals::createMEs().

57  {
58  ApvAnalysisFactory::ApvAnalysisMap::iterator CPos = apvMap_.find(detId);
59  if (CPos != apvMap_.end()) {
60  cout << " APVs for Detector Id " << detId << " already created !!!" << endl;
61  ;
62  return false;
63  }
64  vector<ApvAnalysis*> temp;
65  for (int i = 0; i < numberOfApvs; i++) {
67  // constructAuxiliaryApvClasses(apvTmp);
69  temp.push_back(apvTmp);
70  }
71  apvMap_.insert(pair<uint32_t, vector<ApvAnalysis*> >(detId, temp));
72  return true;
73 }
ApvAnalysisMap apvMap_
void constructAuxiliaryApvClasses(ApvAnalysis *theApv, uint32_t det_id, int thisApv)

◆ isUpdating()

bool ApvAnalysisFactory::isUpdating ( uint32_t  detId)

Definition at line 348 of file ApvAnalysisFactory.cc.

References hcalRecHitTable_cff::detId.

348  {
349  bool updating = true;
350  map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
351  if (apvAnalysisIt != apvMap_.end()) {
352  for (vector<ApvAnalysis*>::const_iterator apvIt = (apvAnalysisIt->second).begin();
353  apvIt != (apvAnalysisIt->second).end();
354  apvIt++) {
355  if (!((*apvIt)->pedestalCalculator().status()->isUpdating()))
356  updating = false;
357  }
358  }
359  return updating;
360 }
ApvAnalysisMap apvMap_

◆ update()

void ApvAnalysisFactory::update ( uint32_t  det_id,
const edm::DetSet< SiStripRawDigi > &  in 
)

Definition at line 180 of file ApvAnalysisFactory.cc.

References edm::DetSet< T >::data, hcalRecHitTable_cff::detId, mps_fire::i, and recoMuon::in.

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), SiStripMonitorPedestals::analyze(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), and MatrixUtil.Steps::overwrite().

180  {
181  map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
182  if (apvAnalysisIt != apvMap_.end()) {
183  size_t i = 0;
184  for (vector<ApvAnalysis*>::const_iterator apvIt = (apvAnalysisIt->second).begin();
185  apvIt != (apvAnalysisIt->second).end();
186  apvIt++) {
187  edm::DetSet<SiStripRawDigi> tmpRawDigi;
188  //it is missing the detId ...
189  tmpRawDigi.data.reserve(128);
190  size_t startStrip = 128 * i;
191  size_t stopStrip = startStrip + 128;
192 
193  for (size_t istrip = startStrip; istrip < stopStrip; istrip++) {
194  if (in.data.size() <= istrip)
195  tmpRawDigi.data.push_back(SiStripRawDigi(0));
196  else
197  tmpRawDigi.data.push_back(in.data[istrip]); //maybe dangerous
198  }
199 
200  (*apvIt)->newEvent();
201  (*apvIt)->updateCalibration(tmpRawDigi);
202  i++;
203  }
204  }
205 }
ApvAnalysisMap apvMap_
collection_type data
Definition: DetSet.h:80
A Digi for the silicon strip detector, containing only adc information, and suitable for storing raw ...

◆ updatePair()

void ApvAnalysisFactory::updatePair ( uint32_t  det_id,
size_t  apvPair,
const edm::DetSet< SiStripRawDigi > &  in 
)

Definition at line 145 of file ApvAnalysisFactory.cc.

References edm::DetSet< T >::data, hcalRecHitTable_cff::detId, and recoMuon::in.

Referenced by PedsOnlyTask::fill(), and NoiseTask::fill().

145  {
146  map<uint32_t, vector<ApvAnalysis*> >::const_iterator apvAnalysisIt = apvMap_.find(detId);
147  if (apvAnalysisIt != apvMap_.end()) {
148  size_t iter = 0;
149 
150  for (vector<ApvAnalysis*>::const_iterator apvIt = (apvAnalysisIt->second).begin();
151  apvIt != (apvAnalysisIt->second).end();
152  apvIt++) {
153  if (iter == pairNumber * 2 || iter == (2 * pairNumber + 1)) {
154  // cout << "ApvAnalysisFactory::updatePair pair number " << pairNumber << endl;
155  // cout << "ApvAnlysis will be updated for the apv # " << iter << endl;
156 
157  edm::DetSet<SiStripRawDigi> tmpRawDigi;
158  tmpRawDigi.data.reserve(128);
159 
160  size_t startStrip = 128 * (iter % 2);
161  size_t stopStrip = startStrip + 128;
162 
163  for (size_t istrip = startStrip; istrip < stopStrip; istrip++) {
164  if (in.data.size() <= istrip)
165  tmpRawDigi.data.push_back(SiStripRawDigi(0));
166  else
167  tmpRawDigi.data.push_back(in.data[istrip]); //maybe dangerous
168  }
169 
170  (*apvIt)->newEvent();
171  (*apvIt)->updateCalibration(tmpRawDigi);
172  }
173 
174  iter++;
175  }
176  }
177 
178 } // void
ApvAnalysisMap apvMap_
collection_type data
Definition: DetSet.h:80
A Digi for the silicon strip detector, containing only adc information, and suitable for storing raw ...

Member Data Documentation

◆ apvMap_

ApvAnalysisMap ApvAnalysisFactory::apvMap_
private

Definition at line 76 of file ApvAnalysisFactory.h.

◆ theAlgorithmType_

std::string ApvAnalysisFactory::theAlgorithmType_
private

Definition at line 77 of file ApvAnalysisFactory.h.

◆ theCMType_

std::string ApvAnalysisFactory::theCMType_
private

Definition at line 86 of file ApvAnalysisFactory.h.

◆ theCutToAvoidSignal_

float ApvAnalysisFactory::theCutToAvoidSignal_
private

Definition at line 83 of file ApvAnalysisFactory.h.

◆ theEventInitNumber_

int ApvAnalysisFactory::theEventInitNumber_
private

Definition at line 84 of file ApvAnalysisFactory.h.

◆ theEventIterNumber_

int ApvAnalysisFactory::theEventIterNumber_
private

Definition at line 85 of file ApvAnalysisFactory.h.

◆ theMaskCalcFlag_

int ApvAnalysisFactory::theMaskCalcFlag_
private

Definition at line 79 of file ApvAnalysisFactory.h.

◆ theMaskDeadCut_

float ApvAnalysisFactory::theMaskDeadCut_
private

Definition at line 81 of file ApvAnalysisFactory.h.

◆ theMaskNoiseCut_

float ApvAnalysisFactory::theMaskNoiseCut_
private

Definition at line 80 of file ApvAnalysisFactory.h.

◆ theMaskTruncCut_

float ApvAnalysisFactory::theMaskTruncCut_
private

Definition at line 82 of file ApvAnalysisFactory.h.

◆ theNumCMstripsInGroup_

int ApvAnalysisFactory::theNumCMstripsInGroup_
private

Definition at line 78 of file ApvAnalysisFactory.h.

◆ useDB_

bool ApvAnalysisFactory::useDB_
private

Definition at line 87 of file ApvAnalysisFactory.h.