CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripSpyDisplayModule Class Reference

EDAnalyzer for the online monitoring of the FED using STT spy channel data. More...

Inheritance diagram for SiStripSpyDisplayModule:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 SiStripSpyDisplayModule (const edm::ParameterSet &)
 
 ~SiStripSpyDisplayModule ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
Bool_t MakeDigiHist_ (const edm::Handle< edm::DetSetVector< SiStripDigi > > &digi_handle, uint32_t detID, const TFileDirectory &dir, FEDSpyHistogramType type)
 
Bool_t MakeProcessedRawDigiHist_ (const edm::Handle< edm::DetSetVector< SiStripProcessedRawDigi > > &digi_handle, uint32_t specifier, const TFileDirectory &dir, FEDSpyHistogramType type)
 
Bool_t MakeRawDigiHist_ (const edm::Handle< edm::DetSetVector< SiStripRawDigi > > &digi_handle, uint32_t specifier, const TFileDirectory &dir, FEDSpyHistogramType type)
 

Private Attributes

std::vector< uint32_t > detIDs_
 Vector of detIDs that are of interest (config-specified). More...
 
edm::InputTag inputCompVirginRawDigiLabel_
 VR RawDigis to compare (from mainline) More...
 
edm::InputTag inputCompZeroSuppressedDigiLabel_
 Zero-suppressed digis to compare (from mainline) More...
 
edm::InputTag inputNoisesLabel_
 Label for the noises. More...
 
edm::InputTag inputPayloadRawDigiLabel_
 Label for the virgin raw RawDigi collection input tag. More...
 
edm::InputTag inputPedestalsLabel_
 Label for the pedestals. More...
 
edm::InputTag inputPostCMRawDigiLabel_
 Label for the post-common mode subtraction RawDigi module input tag. More...
 
edm::InputTag inputPostPedestalRawDigiLabel_
 Label for the post-pedestal subtraction RawDigi module input tag. More...
 
edm::InputTag inputReorderedModuleRawDigiLabel_
 Label for the re-ordered RawDigi module input tag. More...
 
edm::InputTag inputReorderedPayloadRawDigiLabel_
 Label for the re-ordered RawDigi module input tag. More...
 
edm::InputTag inputScopeModeRawDigiLabel_
 Label for the scope-mode RawDigi collection input tag. More...
 
edm::InputTag inputZeroSuppressedDigiLabel_
 Guess what? It's the input label for the zero-suppressed digi. More...
 
edm::InputTag inputZeroSuppressedRawDigiLabel_
 Label for the zero-suppressed, zero-padded RawDigi module input tag. More...
 
std::string outputFolderName_
 Name for the folder in the TFileService file output. More...
 
sistrip::SpyUtilities utility_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

EDAnalyzer for the online monitoring of the FED using STT spy channel data.

Author
Tom Whyntie
Date
Autumn 2009

See https://twiki.cern.ch/twiki/bin/view/CMS/SiStripSpyDisplayModule for further code documentation, and https://twiki.cern.ch/twiki/bin/view/CMS/FEDSpyChannelMonitoring for more information about the spy channel monitoring project.

Definition at line 93 of file SiStripSpyDisplayModule.cc.

Constructor & Destructor Documentation

SiStripSpyDisplayModule::SiStripSpyDisplayModule ( const edm::ParameterSet iConfig)
explicit

Definition at line 158 of file SiStripSpyDisplayModule.cc.

158  :
159  detIDs_( iConfig.getParameter< std::vector<uint32_t> >( "detIDs")),
160  inputScopeModeRawDigiLabel_( iConfig.getParameter<edm::InputTag>( "InputScopeModeRawDigiLabel" ) ),
161  inputPayloadRawDigiLabel_( iConfig.getParameter<edm::InputTag>( "InputPayloadRawDigiLabel" ) ),
162  inputReorderedPayloadRawDigiLabel_( iConfig.getParameter<edm::InputTag>( "InputReorderedPayloadRawDigiLabel" ) ),
163  inputReorderedModuleRawDigiLabel_( iConfig.getParameter<edm::InputTag>( "InputReorderedModuleRawDigiLabel" ) ),
164  inputPedestalsLabel_( iConfig.getParameter<edm::InputTag>( "InputPedestalsLabel" ) ),
165  inputNoisesLabel_( iConfig.getParameter<edm::InputTag>( "InputNoisesLabel" ) ),
166  inputPostPedestalRawDigiLabel_( iConfig.getParameter<edm::InputTag>( "InputPostPedestalRawDigiLabel" ) ),
167  inputPostCMRawDigiLabel_( iConfig.getParameter<edm::InputTag>( "InputPostCMRawDigiLabel" ) ),
168  inputZeroSuppressedRawDigiLabel_( iConfig.getParameter<edm::InputTag>( "InputZeroSuppressedRawDigiLabel" ) ),
169  inputZeroSuppressedDigiLabel_( iConfig.getParameter<edm::InputTag>( "InputZeroSuppressedDigiLabel" ) ),
170  inputCompVirginRawDigiLabel_( iConfig.getParameter<edm::InputTag>( "InputCompVirginRawDigiLabel" ) ),
171  inputCompZeroSuppressedDigiLabel_( iConfig.getParameter<edm::InputTag>( "InputCompZeroSuppressedDigiLabel" ) ),
172  outputFolderName_( iConfig.getParameter<std::string>( "OutputFolderName" ) )
173 {
174  //now do what ever initialization is needed
175 }
edm::InputTag inputZeroSuppressedRawDigiLabel_
Label for the zero-suppressed, zero-padded RawDigi module input tag.
T getParameter(std::string const &) const
edm::InputTag inputCompZeroSuppressedDigiLabel_
Zero-suppressed digis to compare (from mainline)
edm::InputTag inputPayloadRawDigiLabel_
Label for the virgin raw RawDigi collection input tag.
edm::InputTag inputReorderedPayloadRawDigiLabel_
Label for the re-ordered RawDigi module input tag.
edm::InputTag inputPostCMRawDigiLabel_
Label for the post-common mode subtraction RawDigi module input tag.
std::string outputFolderName_
Name for the folder in the TFileService file output.
edm::InputTag inputPostPedestalRawDigiLabel_
Label for the post-pedestal subtraction RawDigi module input tag.
edm::InputTag inputCompVirginRawDigiLabel_
VR RawDigis to compare (from mainline)
edm::InputTag inputScopeModeRawDigiLabel_
Label for the scope-mode RawDigi collection input tag.
edm::InputTag inputNoisesLabel_
Label for the noises.
edm::InputTag inputZeroSuppressedDigiLabel_
Guess what? It&#39;s the input label for the zero-suppressed digi.
edm::InputTag inputPedestalsLabel_
Label for the pedestals.
edm::InputTag inputReorderedModuleRawDigiLabel_
Label for the re-ordered RawDigi module input tag.
std::vector< uint32_t > detIDs_
Vector of detIDs that are of interest (config-specified).
SiStripSpyDisplayModule::~SiStripSpyDisplayModule ( )

Definition at line 178 of file SiStripSpyDisplayModule.cc.

179 {
180  // do anything here that needs to be done at desctruction time
181  // (e.g. close files, deallocate resources etc.)
182 }

Member Function Documentation

void SiStripSpyDisplayModule::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

< detID folder filename

Implements edm::EDAnalyzer.

Definition at line 216 of file SiStripSpyDisplayModule.cc.

References detIDs_, edm::EventID::event(), SiStripFedKey::fedIndex(), edm::Event::getByLabel(), sistrip::SpyUtilities::getDetCabling(), edm::EventBase::id(), inputCompVirginRawDigiLabel_, inputCompZeroSuppressedDigiLabel_, inputNoisesLabel_, inputPayloadRawDigiLabel_, inputPedestalsLabel_, inputPostCMRawDigiLabel_, inputPostPedestalRawDigiLabel_, inputReorderedModuleRawDigiLabel_, inputReorderedPayloadRawDigiLabel_, inputScopeModeRawDigiLabel_, inputZeroSuppressedDigiLabel_, edm::InputTag::instance(), edm::InputTag::label(), MakeDigiHist_(), MakeProcessedRawDigiHist_(), MakeRawDigiHist_(), TFileDirectory::mkdir(), NOISE_VALUES, outputFolderName_, PAYLOAD_RAW, PEDESTAL_VALUES, POST_COMMON_MODE, POST_PEDESTAL, REORDERED_MODULE_RAW, REORDERED_PAYLOAD_RAW, edm::EventID::run(), SCOPE_MODE, utility_, VR_COMP, ZERO_SUPPRESSED, and ZERO_SUPPRESSED_COMP.

217 {
218  using namespace edm;
219  using namespace std;
220 
221  //retrieve cabling
222  const SiStripDetCabling* lCabling = utility_.getDetCabling( iSetup );
223 
224  // Set up the event-level histogram folder
225  //-----------------------------------------
226  // register to the TFileService
228 
229  // Make the EDAnalyzer instance name directory
230  TFileDirectory an_dir = fs->mkdir( outputFolderName_ );
231 
232  // Make the event directory filename
233  stringstream ev_dir_name;
234  ev_dir_name << "run" << iEvent.id().run() << "_event" << iEvent.id().event();
235  TFileDirectory evdir = an_dir.mkdir( ev_dir_name.str() );
236 
237  //if there are no detIds, get them from the comparison digis...
238  if (detIDs_.size()==0) {
239  //get the detIds of the modules in the zero-suppressed comparison
242  iEvent.getByLabel( inputCompZeroSuppressedDigiLabel_, czs_digis );
243  std::vector< edm::DetSet<SiStripDigi> >::const_iterator digis_it = czs_digis->begin();
244  for (; digis_it!=czs_digis->end(); ++digis_it) {
245  detIDs_.push_back(digis_it->detId());
246  }
247  }
250  iEvent.getByLabel( inputCompVirginRawDigiLabel_, cvr_digis );
251  std::vector< edm::DetSet<SiStripRawDigi> >::const_iterator digis_it = cvr_digis->begin();
252  for (; digis_it!=cvr_digis->end(); ++digis_it) {
253  detIDs_.push_back(digis_it->detId());
254  }
255  }
256 
257  }
258 
259  // Loop over detIDs as obtained from the SpyChannelMonitor config file.
260  for (std::vector<uint32_t>::iterator d = detIDs_.begin(); d!=detIDs_.end(); ++d) {
261  // TODO: Need some error checking here, probably...
262  const std::vector<const FedChannelConnection *> & conns = lCabling->getConnections( *d );
263  //cout << "________________________________________________" << endl;
264  //cout << "FED channels found in detId " << *d << " is " << conns.size() << endl;
265  if (!(conns.size())) {
266  // TODO: Properly DEBUG/warning this...
267  //cout << "Skipping detID " << uint32_t(*d) << endl;
268  continue;
269  }
270 
271  // Create a histogram directory for each specified and available detID
272  stringstream sss;
273  sss << "detID_" << *d;
274  TFileDirectory detID_dir = evdir.mkdir( sss.str() );
275 
276  // Loop over the channels found with the detID and add directories.
277  for (uint32_t ch = 0; ch<conns.size(); ch++) {
278 
279  // Name of channel histogram directory
280  stringstream ssss; ssss << sss.str() << "_APVpair_" << ch;
281  TFileDirectory chan_dir = detID_dir.mkdir(ssss.str());
282 
283  // Get the fed key from the detID and the channel
284  uint32_t fedkey = SiStripFedKey::fedIndex(conns[ch]->fedId(), conns[ch]->fedCh());
285 
286  // (Spy) Scope Mode (SM)
287  //=======================
288  // Get the fed key from the FED ID and the FED channel (from conns)
289  // This is because scope mode always stores in the collection by FED ID
291  // Use the SiStripFedKey object to return the FED key
292  //cout << "detID=" << *d << ", FED key looking for is " << fedkey << endl;
293  //cout << "Attempting to find scope mode raw digis" << endl;
294  //
296  iEvent.getByLabel( inputScopeModeRawDigiLabel_, sm_rawdigis );
297  //
298  // Note that the fed key (also a uint32_t) is passed in this case.
299  // The method itself doesn't actually care, but it assumes whatever collection
300  // is stored in sm_rawdigis is indexed by FED key ;-)
301  // TODO: Make this, um, better.
302  if (!(MakeRawDigiHist_(sm_rawdigis, fedkey, chan_dir, SCOPE_MODE))) { ; }
303  }
304 
305  // Payload Unordered Raw (UR)
306  //============================
308  uint32_t fedindex = SiStripFedKey::fedIndex(conns[ch]->fedId(), conns[ch]->fedCh());
309  //cout << "Attempting to find payload mode raw digis" << endl;
311  iEvent.getByLabel( inputPayloadRawDigiLabel_, ur_rawdigis );
312  if (!(MakeRawDigiHist_(ur_rawdigis, fedindex, chan_dir, PAYLOAD_RAW))) { ; }
313  }
314  // Payload Reordered Raw
315  //=======================
317  uint32_t fedkey = SiStripFedKey::fedIndex(conns[ch]->fedId(), conns[ch]->fedCh());
319  iEvent.getByLabel( inputReorderedPayloadRawDigiLabel_, rrp_rawdigis );
320  if (!(MakeRawDigiHist_(rrp_rawdigis, fedkey, chan_dir, REORDERED_PAYLOAD_RAW))) { ; }
321  }
322  } // end of loop over channels
323  //
324  // Module Reordered Raw (RR)
325  //====================
328  iEvent.getByLabel( inputReorderedModuleRawDigiLabel_, rr_rawdigis );
329  //cout << "Making Reordered module histogram for detID " << *d << endl;
330  if (!(MakeRawDigiHist_(rr_rawdigis, *d, detID_dir, REORDERED_MODULE_RAW))) { ; }
331  } // end of ReorderedModuleRaw check
332 
333  //
334  // Pedestal values
335  //========================
336  if (!((inputPedestalsLabel_.label()=="") && (inputPedestalsLabel_.instance()==""))) {
338  iEvent.getByLabel( inputPedestalsLabel_, pd_rawdigis );
339  //cout << "Making pedestal values module histogram for detID " << *d << endl;
340  if (!(MakeRawDigiHist_(pd_rawdigis, *d, detID_dir, PEDESTAL_VALUES))) { ; }
341  }
342  //
343  // Noise values
344  //========================
345  if (!((inputNoisesLabel_.label()=="") && (inputNoisesLabel_.instance()==""))) {
347  iEvent.getByLabel( inputNoisesLabel_, pd_rawdigis );
348  //cout << "Making noise values module histogram for detID " << *d << endl;
349  if (!(MakeProcessedRawDigiHist_(pd_rawdigis, *d, detID_dir, NOISE_VALUES))) { ; }
350  }
351  //
352  // Post-Pedestal Raw (PP)
353  //========================
356  iEvent.getByLabel( inputPostPedestalRawDigiLabel_, pp_rawdigis );
357  //cout << "Making post-pedestal module histogram for detID " << *d << endl;
358  if (!(MakeRawDigiHist_(pp_rawdigis, *d, detID_dir, POST_PEDESTAL))) { ; }
359  }
360  //
361  // Post-Common Mode Subtraction Raw (PC)
362  //=======================================
365  iEvent.getByLabel( inputPostCMRawDigiLabel_, pc_rawdigis );
366  //cout << "Making post-CM module histogram for detID " << *d << endl;
367  if (!(MakeRawDigiHist_(pc_rawdigis, *d, detID_dir, POST_COMMON_MODE))) { ; }
368  }
369 
370  //
371  // Zero-Suppressed Digis
372  //=======================
373  //bool founddigispy = false, founddigimain = false;
375  //cout << "Making ZeroSuppressed histogram!" << endl;
377  iEvent.getByLabel( inputZeroSuppressedDigiLabel_, zs_digis );
378  //founddigispy =
379  MakeDigiHist_(zs_digis, *d, detID_dir, ZERO_SUPPRESSED);
380  }
381  //comparison to mainline data
383  //cout << "Making Mainline VirginRaw histogram!" << endl;
385  iEvent.getByLabel( inputCompVirginRawDigiLabel_, cvr_digis );
386  //founddigimain =
387  MakeRawDigiHist_(cvr_digis, *d, detID_dir, VR_COMP);
388  }
390  //cout << "Making ZeroSuppressed histogram!" << endl;
392  iEvent.getByLabel( inputCompZeroSuppressedDigiLabel_, czs_digis );
393  //founddigimain =
394  MakeDigiHist_(czs_digis, *d, detID_dir, ZERO_SUPPRESSED_COMP);
395  }
396  //if (founddigimain && founddigispy) cout << "Found digis for both in detid=" << *d << endl;
397 
398  } // end of loop over detIDs specified in the config.
399 
400 } // end of Analyze method.
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
edm::InputTag inputCompZeroSuppressedDigiLabel_
Zero-suppressed digis to compare (from mainline)
edm::InputTag inputPayloadRawDigiLabel_
Label for the virgin raw RawDigi collection input tag.
Bool_t MakeDigiHist_(const edm::Handle< edm::DetSetVector< SiStripDigi > > &digi_handle, uint32_t detID, const TFileDirectory &dir, FEDSpyHistogramType type)
const SiStripDetCabling * getDetCabling(const edm::EventSetup &)
Updates the det cabling object from the DB.
edm::InputTag inputReorderedPayloadRawDigiLabel_
Label for the re-ordered RawDigi module input tag.
static uint32_t fedIndex(const uint16_t &fed_id, const uint16_t &fed_ch)
edm::InputTag inputPostCMRawDigiLabel_
Label for the post-common mode subtraction RawDigi module input tag.
std::string outputFolderName_
Name for the folder in the TFileService file output.
edm::InputTag inputPostPedestalRawDigiLabel_
Label for the post-pedestal subtraction RawDigi module input tag.
edm::InputTag inputCompVirginRawDigiLabel_
VR RawDigis to compare (from mainline)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
edm::InputTag inputScopeModeRawDigiLabel_
Label for the scope-mode RawDigi collection input tag.
edm::InputTag inputNoisesLabel_
Label for the noises.
std::string const & label() const
Definition: InputTag.h:42
edm::EventID id() const
Definition: EventBase.h:56
edm::InputTag inputZeroSuppressedDigiLabel_
Guess what? It&#39;s the input label for the zero-suppressed digi.
sistrip::SpyUtilities utility_
Bool_t MakeRawDigiHist_(const edm::Handle< edm::DetSetVector< SiStripRawDigi > > &digi_handle, uint32_t specifier, const TFileDirectory &dir, FEDSpyHistogramType type)
edm::InputTag inputPedestalsLabel_
Label for the pedestals.
edm::InputTag inputReorderedModuleRawDigiLabel_
Label for the re-ordered RawDigi module input tag.
Bool_t MakeProcessedRawDigiHist_(const edm::Handle< edm::DetSetVector< SiStripProcessedRawDigi > > &digi_handle, uint32_t specifier, const TFileDirectory &dir, FEDSpyHistogramType type)
std::string const & instance() const
Definition: InputTag.h:43
std::vector< uint32_t > detIDs_
Vector of detIDs that are of interest (config-specified).
void SiStripSpyDisplayModule::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 201 of file SiStripSpyDisplayModule.cc.

References edm::hlt::Exception, and edm::Service< T >::isAvailable().

202 {
203  // register to the TFileService
205  // Check that the TFileService has been configured
206  if ( !fs.isAvailable() ) {
207  throw cms::Exception("Configuration") << "TFileService not available: did you configure it ?";
208  }
209 } // end of beginJob method.
bool isAvailable() const
Definition: Service.h:47
void SiStripSpyDisplayModule::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 189 of file SiStripSpyDisplayModule.cc.

190 {
191  // Retrieve FED cabling object
192  //iSetup.get<SiStripDetCablingRcd>().get( cabling_ );
193  //std::stringstream ss;
194  //cabling_->print(ss);
195  //std::cout << ss.str() << std::endl;
196 
197 } // end of beginRun method.
void SiStripSpyDisplayModule::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 212 of file SiStripSpyDisplayModule.cc.

212 {}
Bool_t SiStripSpyDisplayModule::MakeDigiHist_ ( const edm::Handle< edm::DetSetVector< SiStripDigi > > &  digi_handle,
uint32_t  detID,
const TFileDirectory dir,
FEDSpyHistogramType  type 
)
private

Definition at line 475 of file SiStripSpyDisplayModule.cc.

References edm::DetSet< T >::data, estimatePileup::hist, TFileDirectory::make(), ZERO_SUPPRESSED, and ZERO_SUPPRESSED_COMP.

Referenced by analyze().

482 {
483  // TODO: Remove the hard-coded numbers.
484  TH1S * hist;
485  if (type==ZERO_SUPPRESSED) hist = dir.make<TH1S>("ZeroSuppressedDigi", ";Strip number;ADC counts / strip", 768, 0, 768);
486  else if (type==ZERO_SUPPRESSED_COMP) hist = dir.make<TH1S>("ZeroSuppressedDigiComp", ";Strip number;ADC counts / strip", 768, 0, 768);
487  else {hist = 0; return false;}
488 
489  // TODO: May need to make this error checking independent when refactoring...
490  std::vector< edm::DetSet<SiStripDigi> >::const_iterator digis_it = digi_handle->find( detID );
491  if (digis_it == digi_handle->end()) {
492  return false;
493  }
494  else {
495  //cout << "--* ZS digis found for detID " << detID << endl;
496  }
497 
498  // Loop over the digis for the detID and APV pair.
499  edm::DetSet<SiStripDigi>::const_iterator idigi = digis_it->data.begin();
500  bool founddigi = false;
501  for ( ; idigi != digis_it->data.end(); ++idigi ) {
502  // Check strip number is within the channel limits
503  //if ( static_cast<uint16_t>( (*idigi).strip()/256. ) == channel ) {
504  // hist->SetBinContent( ((*idigi).strip())%256 + 1,(*idigi).adc());
505  //}
506  hist->SetBinContent( static_cast<int>(((*idigi).strip())) + 1, static_cast<int>((*idigi).adc()) );
507  if ( (*idigi).adc() > 0 ) founddigi = true;
508  //cout << "----* ZS digi found at " << static_cast<int>(((*idigi).strip()))
509  // << ", " << static_cast<int>((*idigi).adc()) << endl;
510  } // end of loop over the digis
511 
512  return founddigi;
513 }
type
Definition: HCALResponse.h:21
iterator find(det_id_type id)
Definition: DetSetVector.h:285
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:356
collection_type data
Definition: DetSet.h:79
T * make() const
make new ROOT object
collection_type::const_iterator const_iterator
Definition: DetSet.h:34
Bool_t SiStripSpyDisplayModule::MakeProcessedRawDigiHist_ ( const edm::Handle< edm::DetSetVector< SiStripProcessedRawDigi > > &  digi_handle,
uint32_t  specifier,
const TFileDirectory dir,
FEDSpyHistogramType  type 
)
private

Definition at line 441 of file SiStripSpyDisplayModule.cc.

References prof2calltree::count, edm::DetSet< T >::data, estimatePileup::hist, TFileDirectory::make(), and NOISE_VALUES.

Referenced by analyze().

447 {
448  // TODO: Remove the hard-coded numbers(!).
449  TH1F * hist;
450  if (type==NOISE_VALUES) hist = dir.make<TH1F>("NoiseValues",";Strip number;Noise / strip",768, 0, 768);
451  else {
452  hist = 0;
453  return false;
454  }
455 
456  // TODO: May need to make this error checking independent when refactoring...
457  //std::cout << "| * digis for " << type << " and detID " << specifier;
458  std::vector< edm::DetSet<SiStripProcessedRawDigi> >::const_iterator digis_it = digi_handle->find( specifier );
459  if (digis_it == digi_handle->end()) {
460  //std::cout << " not found :( ";
461  return false;
462  }
463  //std::cout << std::endl;
464 
465  // Loop over the digis for the detID and APV pair.
466  edm::DetSet<SiStripProcessedRawDigi>::const_iterator idigi = digis_it->data.begin();
467  uint32_t count = 0;
468  for ( ; idigi != digis_it->data.end(); ++idigi ) {
469  count++;
470  hist->SetBinContent(count,static_cast<float>((*idigi).adc()));
471  } // end of loop over the digis
472  return true; // Success! (Probably.)
473 }
type
Definition: HCALResponse.h:21
collection_type data
Definition: DetSet.h:79
T * make() const
make new ROOT object
collection_type::const_iterator const_iterator
Definition: DetSet.h:34
Bool_t SiStripSpyDisplayModule::MakeRawDigiHist_ ( const edm::Handle< edm::DetSetVector< SiStripRawDigi > > &  digi_handle,
uint32_t  specifier,
const TFileDirectory dir,
FEDSpyHistogramType  type 
)
private

Definition at line 402 of file SiStripSpyDisplayModule.cc.

References prof2calltree::count, edm::DetSet< T >::data, estimatePileup::hist, TFileDirectory::make(), PAYLOAD_RAW, PEDESTAL_VALUES, POST_COMMON_MODE, POST_PEDESTAL, REORDERED_MODULE_RAW, REORDERED_PAYLOAD_RAW, SCOPE_MODE, VR_COMP, and ZERO_SUPPRESSED_PADDED.

Referenced by analyze().

408 {
409  // TODO: Remove the hard-coded numbers(!).
410  TH1S * hist;
411  if (type==SCOPE_MODE) hist = dir.make<TH1S>("ScopeMode", ";Sample number;ADC counts / strip", 298, 0, 298);
412  else if (type==PAYLOAD_RAW) hist = dir.make<TH1S>("PayloadRaw", ";Sample number;ADC counts / strip", 256, 0, 256);
413  else if (type==REORDERED_PAYLOAD_RAW) hist = dir.make<TH1S>("ReorderedPayloadRaw", ";Sample number;ADC counts / strip", 256, 0, 256);
414  else if (type==REORDERED_MODULE_RAW) hist = dir.make<TH1S>("ReorderedModuleRaw", ";Sample number;ADC counts / strip", 768, 0, 768);
415  else if (type==PEDESTAL_VALUES) hist = dir.make<TH1S>("PedestalValues", ";Strip number;Pedestal / strip", 768, 0, 768);
416  else if (type==POST_PEDESTAL) hist = dir.make<TH1S>("PostPedestal", ";Strip number;ADC counts / strip", 768, 0, 768);
417  else if (type==POST_COMMON_MODE) hist = dir.make<TH1S>("PostCommonMode", ";Strip number;ADC counts / strip", 768, 0, 768);
418  else if (type==ZERO_SUPPRESSED_PADDED) hist = dir.make<TH1S>("ZeroSuppressedRaw" , ";Strip number;ADC counts / strip", 768, 0, 768);
419  else if (type==VR_COMP) hist = dir.make<TH1S>("VirginRawCom" , ";Strip number;ADC counts / strip", 768, 0, 768);
420  else {hist = 0; return false;}
421 
422  // TODO: May need to make this error checking independent when refactoring...
423  //std::cout << "| * digis for " << type << " and detID " << specifier;
424  std::vector< edm::DetSet<SiStripRawDigi> >::const_iterator digis_it = digi_handle->find( specifier );
425  if (digis_it == digi_handle->end()) {
426  //std::cout << " not found :( ";
427  return false;
428  }
429  //std::cout << std::endl;
430 
431  // Loop over the digis for the detID and APV pair.
432  edm::DetSet<SiStripRawDigi>::const_iterator idigi = digis_it->data.begin();
433  uint32_t count = 0;
434  for ( ; idigi != digis_it->data.end(); ++idigi ) {
435  count++;
436  hist->SetBinContent(count,static_cast<int>((*idigi).adc()));
437  } // end of loop over the digis
438  return true; // Success! (Probably.)
439 }
type
Definition: HCALResponse.h:21
iterator find(det_id_type id)
Definition: DetSetVector.h:285
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:356
collection_type data
Definition: DetSet.h:79
T * make() const
make new ROOT object
collection_type::const_iterator const_iterator
Definition: DetSet.h:34

Member Data Documentation

std::vector<uint32_t> SiStripSpyDisplayModule::detIDs_
private

Vector of detIDs that are of interest (config-specified).

Definition at line 120 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

edm::InputTag SiStripSpyDisplayModule::inputCompVirginRawDigiLabel_
private

VR RawDigis to compare (from mainline)

Definition at line 137 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

edm::InputTag SiStripSpyDisplayModule::inputCompZeroSuppressedDigiLabel_
private

Zero-suppressed digis to compare (from mainline)

Definition at line 138 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

edm::InputTag SiStripSpyDisplayModule::inputNoisesLabel_
private

Label for the noises.

Definition at line 132 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

edm::InputTag SiStripSpyDisplayModule::inputPayloadRawDigiLabel_
private

Label for the virgin raw RawDigi collection input tag.

Definition at line 128 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

edm::InputTag SiStripSpyDisplayModule::inputPedestalsLabel_
private

Label for the pedestals.

Definition at line 131 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

edm::InputTag SiStripSpyDisplayModule::inputPostCMRawDigiLabel_
private

Label for the post-common mode subtraction RawDigi module input tag.

Definition at line 134 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

edm::InputTag SiStripSpyDisplayModule::inputPostPedestalRawDigiLabel_
private

Label for the post-pedestal subtraction RawDigi module input tag.

Definition at line 133 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

edm::InputTag SiStripSpyDisplayModule::inputReorderedModuleRawDigiLabel_
private

Label for the re-ordered RawDigi module input tag.

Definition at line 130 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

edm::InputTag SiStripSpyDisplayModule::inputReorderedPayloadRawDigiLabel_
private

Label for the re-ordered RawDigi module input tag.

Definition at line 129 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

edm::InputTag SiStripSpyDisplayModule::inputScopeModeRawDigiLabel_
private

Label for the scope-mode RawDigi collection input tag.

Definition at line 127 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

edm::InputTag SiStripSpyDisplayModule::inputZeroSuppressedDigiLabel_
private

Guess what? It's the input label for the zero-suppressed digi.

Definition at line 136 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

edm::InputTag SiStripSpyDisplayModule::inputZeroSuppressedRawDigiLabel_
private

Label for the zero-suppressed, zero-padded RawDigi module input tag.

Definition at line 135 of file SiStripSpyDisplayModule.cc.

std::string SiStripSpyDisplayModule::outputFolderName_
private

Name for the folder in the TFileService file output.

Definition at line 142 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().

sistrip::SpyUtilities SiStripSpyDisplayModule::utility_
private

Definition at line 123 of file SiStripSpyDisplayModule.cc.

Referenced by analyze().