CMS 3D CMS Logo

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

#include <SiStripPedestalsSubtractor.h>

Public Member Functions

void init (const edm::EventSetup &)
 
void subtract (const edm::DetSet< SiStripRawDigi > &input, std::vector< int16_t > &output)
 
void subtract (uint32_t detId, uint16_t firstAPV, std::vector< int16_t > &adcs)
 

Private Member Functions

int16_t eval (int16_t in)
 
uint16_t eval (SiStripRawDigi in)
 
 SiStripPedestalsSubtractor (bool mode, edm::ConsumesCollector iC)
 
template<class input_t >
void subtract_ (uint32_t detId, uint16_t firstAPV, const input_t &input, std::vector< int16_t > &output)
 

Private Attributes

bool fedmode_
 
std::vector< int > pedestals
 
const SiStripPedestalspedestalsHandle
 
edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcdpedestalsToken_
 
edm::ESWatcher< SiStripPedestalsRcdpedestalsWatcher_
 

Friends

class SiStripRawProcessingFactory
 

Detailed Description

Definition at line 14 of file SiStripPedestalsSubtractor.h.

Constructor & Destructor Documentation

◆ SiStripPedestalsSubtractor()

SiStripPedestalsSubtractor::SiStripPedestalsSubtractor ( bool  mode,
edm::ConsumesCollector  iC 
)
inlineprivate

Member Function Documentation

◆ eval() [1/2]

int16_t SiStripPedestalsSubtractor::eval ( int16_t  in)
inlineprivate

Definition at line 33 of file SiStripPedestalsSubtractor.h.

33 { return in; }

References recoMuon::in.

Referenced by subtract_().

◆ eval() [2/2]

uint16_t SiStripPedestalsSubtractor::eval ( SiStripRawDigi  in)
inlineprivate

Definition at line 34 of file SiStripPedestalsSubtractor.h.

34 { return in.adc(); }

References recoMuon::in.

◆ init()

void SiStripPedestalsSubtractor::init ( const edm::EventSetup es)

◆ subtract() [1/2]

void SiStripPedestalsSubtractor::subtract ( const edm::DetSet< SiStripRawDigi > &  input,
std::vector< int16_t > &  output 
)

Definition at line 14 of file SiStripPedestalsSubtractor.cc.

14  {
15  subtract_(input.id, 0, input, output);
16 }

References input, convertSQLitetoXML_cfg::output, and subtract_().

◆ subtract() [2/2]

void SiStripPedestalsSubtractor::subtract ( uint32_t  detId,
uint16_t  firstAPV,
std::vector< int16_t > &  adcs 
)

Definition at line 11 of file SiStripPedestalsSubtractor.cc.

11  {
12  subtract_(detId, firstStrip, digis, digis);
13 }

References subtract_().

◆ subtract_()

template<class input_t >
void SiStripPedestalsSubtractor::subtract_ ( uint32_t  detId,
uint16_t  firstAPV,
const input_t &  input,
std::vector< int16_t > &  output 
)
inlineprivate

Definition at line 19 of file SiStripPedestalsSubtractor.cc.

22  {
23  try {
24  pedestals.resize(firstStrip + input.size());
25  SiStripPedestals::Range pedestalsRange = pedestalsHandle->getRange(id);
26  pedestalsHandle->allPeds(pedestals, pedestalsRange);
27 
28  typename input_t::const_iterator inDigi = input.begin();
29  std::vector<int>::const_iterator ped = pedestals.begin() + firstStrip;
30  std::vector<int16_t>::iterator outDigi = output.begin();
31 
32  while (inDigi != input.end()) {
33  *outDigi = eval(*inDigi) - *ped + ((*ped > 895) ? 1024 : 0);
34 
35  if (fedmode_ && *outDigi < 0) //FED bottoms out at 0
36  *outDigi = 0;
37 
38  ++inDigi;
39  ++ped;
40  ++outDigi;
41  }
42 
43  } catch (cms::Exception& e) {
44  edm::LogError("SiStripPedestalsSubtractor") << "[SiStripPedestalsSubtractor::subtract] DetId " << id
45  << " propagating error from SiStripPedestal" << e.what();
46  output.clear();
47  }
48 }

References SiStripPedestals::allPeds(), MillePedeFileConverter_cfg::e, eval(), fedmode_, SiStripPedestals::getRange(), input, convertSQLitetoXML_cfg::output, pedestals, and pedestalsHandle.

Referenced by subtract().

Friends And Related Function Documentation

◆ SiStripRawProcessingFactory

friend class SiStripRawProcessingFactory
friend

Definition at line 15 of file SiStripPedestalsSubtractor.h.

Member Data Documentation

◆ fedmode_

bool SiStripPedestalsSubtractor::fedmode_
private

Definition at line 29 of file SiStripPedestalsSubtractor.h.

Referenced by subtract_().

◆ pedestals

std::vector<int> SiStripPedestalsSubtractor::pedestals
private

Definition at line 28 of file SiStripPedestalsSubtractor.h.

Referenced by subtract_().

◆ pedestalsHandle

const SiStripPedestals* SiStripPedestalsSubtractor::pedestalsHandle
private

Definition at line 27 of file SiStripPedestalsSubtractor.h.

Referenced by init(), and subtract_().

◆ pedestalsToken_

edm::ESGetToken<SiStripPedestals, SiStripPedestalsRcd> SiStripPedestalsSubtractor::pedestalsToken_
private

Definition at line 25 of file SiStripPedestalsSubtractor.h.

Referenced by init().

◆ pedestalsWatcher_

edm::ESWatcher<SiStripPedestalsRcd> SiStripPedestalsSubtractor::pedestalsWatcher_
private

Definition at line 26 of file SiStripPedestalsSubtractor.h.

Referenced by init().

edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
input
static const std::string input
Definition: EdmProvDump.cc:48
SiStripPedestals::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripPedestals.h:51
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
SiStripPedestalsSubtractor::pedestals
std::vector< int > pedestals
Definition: SiStripPedestalsSubtractor.h:28
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
SiStripPedestalsSubtractor::fedmode_
bool fedmode_
Definition: SiStripPedestalsSubtractor.h:29
SiStripPedestalsSubtractor::pedestalsToken_
edm::ESGetToken< SiStripPedestals, SiStripPedestalsRcd > pedestalsToken_
Definition: SiStripPedestalsSubtractor.h:25
SiStripPedestalsSubtractor::pedestalsHandle
const SiStripPedestals * pedestalsHandle
Definition: SiStripPedestalsSubtractor.h:27
SiStripPedestalsSubtractor::pedestalsWatcher_
edm::ESWatcher< SiStripPedestalsRcd > pedestalsWatcher_
Definition: SiStripPedestalsSubtractor.h:26
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
SiStripPedestalsRcd
Definition: SiStripCondDataRecords.h:43
SiStripPedestalsSubtractor::subtract_
void subtract_(uint32_t detId, uint16_t firstAPV, const input_t &input, std::vector< int16_t > &output)
Definition: SiStripPedestalsSubtractor.cc:19
SiStripPedestals::allPeds
void allPeds(std::vector< int > &pefs, const Range &range) const
Definition: SiStripPedestals.cc:143
SiStripPedestals::getRange
const Range getRange(const uint32_t &detID) const
Definition: SiStripPedestals.cc:28
recoMuon::in
Definition: RecoMuonEnumerators.h:6
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
SiStripPedestalsSubtractor::eval
int16_t eval(int16_t in)
Definition: SiStripPedestalsSubtractor.h:33
SiStripPedestals
Definition: SiStripPedestals.h:27
cms::Exception
Definition: Exception.h:70
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37