CMS 3D CMS Logo

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

#include <ZDCTask.h>

Inheritance diagram for ZDCTask:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
 
 ZDCTask (edm::ParameterSet const &)
 
virtual ~ZDCTask ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Public Attributes

tuple zdcTask
 

Protected Member Functions

virtual void analyze (edm::Event const &, edm::EventSetup 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)
 

Protected Attributes

MonitorElement_cADC
 
std::map< std::string,
MonitorElement * > 
_cADC_EChannel
 
MonitorElement_cADC_vs_TS
 
std::map< std::string,
MonitorElement * > 
_cADC_vs_TS_EChannel
 
MonitorElement_cShape
 
std::map< std::string,
MonitorElement * > 
_cShape_EChannel
 
double _cut
 
int _ped
 
edm::InputTag _tagQIE10
 
edm::EDGetTokenT
< ZDCDigiCollection
_tokQIE10
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 22 of file ZDCTask.h.

Constructor & Destructor Documentation

ZDCTask::ZDCTask ( edm::ParameterSet const &  ps)

Definition at line 7 of file ZDCTask.cc.

References edm::ParameterSet::getUntrackedParameter(), and HLT_25ns10e33_v2_cff::InputTag.

8 {
9 
10  // tags
11  _tagQIE10 = ps.getUntrackedParameter<edm::InputTag>("tagQIE10",
12  edm::InputTag("hcalDigis"));
13  _tokQIE10 = consumes<ZDCDigiCollection>(_tagQIE10);
14 
15  // cuts
16  _cut = ps.getUntrackedParameter<double>("cut", 50.0);
17  _ped = ps.getUntrackedParameter<int>("ped", 4);
18 }
double _cut
Definition: ZDCTask.h:39
edm::EDGetTokenT< ZDCDigiCollection > _tokQIE10
Definition: ZDCTask.h:36
edm::InputTag _tagQIE10
Definition: ZDCTask.h:35
int _ped
Definition: ZDCTask.h:40
virtual ZDCTask::~ZDCTask ( )
inlinevirtual

Definition at line 26 of file ZDCTask.h.

26 {}

Member Function Documentation

void ZDCTask::analyze ( edm::Event const &  e,
edm::EventSetup const &   
)
protectedvirtual

Implements edm::stream::EDAnalyzerBase.

Definition at line 157 of file ZDCTask.cc.

References ecalMGPA::adc(), HcalElectronicsId::dccid(), ZDCDataFrame::elecId(), HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), edm::Event::getByToken(), i, j, ZDCDataFrame::size(), and HcalElectronicsId::spigot().

158 {
160  if (!e.getByToken(_tokQIE10, cqie10))
161  edm::LogError("Collection ZDCDigiCollection isn't available"
162  + _tagQIE10.label() + " " + _tagQIE10.instance());
163 
164 
165  for (uint32_t i=0; i<cqie10->size(); i++)
166  {
167  ZDCDataFrame frame = static_cast<ZDCDataFrame>((*cqie10)[i]);
168  HcalElectronicsId eid = frame.elecId();
169 
170  char histoname[300];
171  sprintf(histoname,"%d_%d_%d_%d",eid.fiberChanId(),eid.fiberIndex(),eid.spigot(),eid.dccid());
172 
173  // compute the signal, ped subracted
174  //double q = hcaldqm::utilities::sumQ_v10<ZDCDataFrame>(frame, constants::adc2fC[_ped], 0, frame.size()-1);
175 
176  // iterate thru all TS and fill
177  for (int j=0; j<frame.size(); j++)
178  {
179  _cShape_EChannel[histoname]->Fill(j, frame[j].nominal_fC());
180  _cShape->Fill(j, frame[j].nominal_fC());
181 
182  _cADC_EChannel[histoname]->Fill(frame[j].adc());
183  _cADC->Fill(frame[j].adc());
184 
185  _cADC_vs_TS_EChannel[histoname]->Fill(j,frame[j].adc());
186  _cADC_vs_TS->Fill(j,frame[j].adc());
187 
188 
189  }
190  }
191 }
int adc(sample_type sample)
get the ADC sample (12 bits)
std::map< std::string, MonitorElement * > _cADC_EChannel
Definition: ZDCTask.h:45
int i
Definition: DBlmapReader.cc:9
int fiberIndex() const
get the fiber index. For VME 1-8 (which of eight fibers carried by a spigot), for uTCA fibers are zer...
edm::EDGetTokenT< ZDCDigiCollection > _tokQIE10
Definition: ZDCTask.h:36
edm::InputTag _tagQIE10
Definition: ZDCTask.h:35
std::map< std::string, MonitorElement * > _cShape_EChannel
Definition: ZDCTask.h:44
MonitorElement * _cShape
Definition: ZDCTask.h:50
void Fill(long long x)
int dccid() const
get the (Hcal local) DCC id for VME, crate number for uTCA
int j
Definition: DBlmapReader.cc:9
int fiberChanId() const
get the fiber channel id (which of channels on a fiber)
MonitorElement * _cADC_vs_TS
Definition: ZDCTask.h:52
int spigot() const
get the spigot (input number on DCC, AMC card number for uTCA)
int size() const
total number of samples in the digi
Definition: ZDCDataFrame.h:26
MonitorElement * _cADC
Definition: ZDCTask.h:51
std::string const & label() const
Definition: InputTag.h:36
std::map< std::string, MonitorElement * > _cADC_vs_TS_EChannel
Definition: ZDCTask.h:46
const HcalElectronicsId & elecId() const
Definition: ZDCDataFrame.h:23
Readout chain identification for Hcal.
std::string const & instance() const
Definition: InputTag.h:37
void ZDCTask::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  r,
edm::EventSetup const &  es 
)
virtual

Implements DQMEDAnalyzer.

Definition at line 20 of file ZDCTask.cc.

References hcaldqm::constants::BIT_OFFSET, DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookProfile(), DQMStore::IBooker::cd(), hcaldqm::quantity::fADC_128, hcaldqm::quantity::ffC_10000, hcaldqm::quantity::fTiming_TS, hcaldqm::quantity::fYAxis, MonitorElement::getRootObject(), hcaldqm::quantity::ValueQuantity::max(), hcaldqm::quantity::ValueQuantity::min(), hcaldqm::quantity::ValueQuantity::nbins(), MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and HcalElectronicsId::setHTR().

22 {
23 
24  //############################## hardcode manually the zdc mapping #############################
25  //############################# this follows from https://github.com/cms-sw/cmssw/blob/CMSSW_8_0_X/EventFilter/CastorRawToDigi/src/ZdcUnpacker.cc#L118
26  //##############################################################################################
28  //PZDC
29  std::map<HcalElectronicsId,DetId> myEMap;
30  HcalElectronicsId eid = HcalElectronicsId(0, 1, 0, 3);
31  eid.setHTR(18, 8, 1);
32  myEMap[eid]=DetId(0x54000051);//PZDC EM1
33 
34  eid = HcalElectronicsId(1, 1, 0, 3);
35  eid.setHTR(18, 8, 1);
36  myEMap[eid]=DetId(0x54000052);//PZDC EM2
37 
38  eid = HcalElectronicsId(2, 1, 0, 3);
39  eid.setHTR(18, 8, 1);
40  myEMap[eid]=DetId(0x54000053);//PZDC EM3
41 
42  eid = HcalElectronicsId(0, 2, 0, 3);
43  eid.setHTR(18, 8, 1);
44  myEMap[eid]=DetId(0x54000061);//PZDC HAD1
45 
46  eid = HcalElectronicsId(1, 2, 0, 3);
47  eid.setHTR(18, 8, 1);
48  myEMap[eid]=DetId(0x54000054);//PZDC EM4
49 
50  eid = HcalElectronicsId(2, 2, 0, 3);
51  eid.setHTR(18, 8, 1);
52  myEMap[eid]=DetId(0x54000055);//PZDC EM5
53 
54  eid = HcalElectronicsId(0, 3, 0, 3);
55  eid.setHTR(18, 8, 1);
56  myEMap[eid]=DetId(0x54000062);//PZDC HAD2
57 
58  eid = HcalElectronicsId(1, 3, 0, 3);
59  eid.setHTR(18, 8, 1);
60  myEMap[eid]=DetId(0x54000063);//PZDC HAD3
61 
62  eid = HcalElectronicsId(2, 3, 0, 3);
63  eid.setHTR(18, 8, 1);
64  myEMap[eid]=DetId(0x54000064);//PZDC HAD4
65 
66  //NZDC
67  eid = HcalElectronicsId(0,1,1,3);
68  eid.setHTR(18, 8, 0);
69  myEMap[eid]=DetId(0x54000011);//NZDC EM1
70 
71  eid = HcalElectronicsId(1,1,1,3);
72  eid.setHTR(18, 8, 0);
73  myEMap[eid]=DetId(0x54000012);//NZDC EM2
74 
75  eid = HcalElectronicsId(2,1,1,3);
76  eid.setHTR(18, 8, 0);
77  myEMap[eid]=DetId(0x54000013);//NZDC EM3
78 
79  eid = HcalElectronicsId(0,2,1,3);
80  eid.setHTR(18, 8, 0);
81  myEMap[eid]=DetId(0x54000015);//NZDC EM5
82 
83  eid = HcalElectronicsId(1,2,1,3);
84  eid.setHTR(18, 8, 0);
85  myEMap[eid]=DetId(0x54000021);//NZDC HAD1
86 
87  eid = HcalElectronicsId(2,2,1,3);
88  eid.setHTR(18, 8, 0);
89  myEMap[eid]=DetId(0x54000014);//NZDC EM4
90 
91  eid = HcalElectronicsId(0,3,1,3);
92  eid.setHTR(18, 8, 0);
93  myEMap[eid]=DetId(0x54000022);//NZDC HAD2
94 
95  eid = HcalElectronicsId(1,3,1,3);
96  eid.setHTR(18, 8, 0);
97  myEMap[eid]=DetId(0x54000023);//NZDC HAD3
98 
99  eid = HcalElectronicsId(2,3,1,3);
100  eid.setHTR(18, 8, 0);
101  myEMap[eid]=DetId(0x54000024);//NZDC HAD4
102  //##################################### end hardcoding ###################################
103 
104  ib.cd();
105 
106  //quantities for axis
109 
111 
112  //book histos per channel
113  for (std::map<HcalElectronicsId,DetId>::const_iterator itr=myEMap.begin(); itr!=myEMap.end(); ++itr)
114  {
115  char histoname[300];
116 
117  sprintf(histoname,"%d_%d_%d_%d",itr->first.fiberChanId(),itr->first.fiberIndex(),itr->first.spigot(),itr->first.dccid());
118 
119  ib.setCurrentFolder("Hcal/ZDCTask/Shape_perChannel");
120  _cShape_EChannel[histoname] = ib.bookProfile(histoname,histoname,xAxisShape.nbins(),xAxisShape.min(),xAxisShape.max(),yAxisShape.nbins(),yAxisShape.min(),yAxisShape.max());
121  _cShape_EChannel[histoname]->setAxisTitle("Timing",1);
122  _cShape_EChannel[histoname]->setAxisTitle("fC QIE8",2);
123 
124  ib.setCurrentFolder("Hcal/ZDCTask/ADC_perChannel");
125  _cADC_EChannel[histoname] = ib.book1D(histoname,histoname,xAxisADC.nbins(),xAxisADC.min(),xAxisADC.max());
127  _cADC_EChannel[histoname]->setAxisTitle("ADC QIE8",1);
128 
129  ib.setCurrentFolder("Hcal/ZDCTask/ADC_vs_TS_perChannel");
130  _cADC_vs_TS_EChannel[histoname] = ib.book2D(histoname,histoname,xAxisShape.nbins(),xAxisShape.min(),xAxisShape.max(),xAxisADC.nbins(),xAxisADC.min(),xAxisADC.max());
132  _cADC_vs_TS_EChannel[histoname]->setAxisTitle("Timing",1);
133  _cADC_vs_TS_EChannel[histoname]->setAxisTitle("ADC QIE8",2);
134 
135 
136  }
137 
138  //book global histos
139  ib.setCurrentFolder("Hcal/ZDCTask");
140 
141  _cShape = ib.bookProfile("Shape","Shape",xAxisShape.nbins(),xAxisShape.min(),xAxisShape.max(),yAxisShape.nbins(),yAxisShape.min(),yAxisShape.max());
142  _cShape->setAxisTitle("Timing",1);
143  _cShape->setAxisTitle("fC QIE8",2);
144 
145  _cADC = ib.book1D("ADC","ADC",xAxisADC.nbins(),xAxisADC.min(),xAxisADC.max());
147  _cADC->setAxisTitle("ADC QIE8",1);
148 
149  _cADC_vs_TS = ib.book2D("ADC_vs_TS","ADC_vs_TS",xAxisShape.nbins(),xAxisShape.min(),xAxisShape.max(),xAxisADC.nbins(),xAxisADC.min(),xAxisADC.max());
151  _cADC_vs_TS->setAxisTitle("Timing",1);
152  _cADC_vs_TS->setAxisTitle("ADC QIE8",2);
153 
154 }
std::map< std::string, MonitorElement * > _cADC_EChannel
Definition: ZDCTask.h:45
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
void cd(void)
Definition: DQMStore.cc:268
std::map< std::string, MonitorElement * > _cShape_EChannel
Definition: ZDCTask.h:44
MonitorElement * _cShape
Definition: ZDCTask.h:50
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * _cADC_vs_TS
Definition: ZDCTask.h:52
Definition: DetId.h:18
void setHTR(int crate, int slot, int tb)
TObject * getRootObject(void) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * _cADC
Definition: ZDCTask.h:51
std::map< std::string, MonitorElement * > _cADC_vs_TS_EChannel
Definition: ZDCTask.h:46
int const BIT_OFFSET
Definition: Constants.h:263
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Readout chain identification for Hcal.

Member Data Documentation

MonitorElement* ZDCTask::_cADC
protected

Definition at line 51 of file ZDCTask.h.

std::map<std::string,MonitorElement*> ZDCTask::_cADC_EChannel
protected

Definition at line 45 of file ZDCTask.h.

MonitorElement* ZDCTask::_cADC_vs_TS
protected

Definition at line 52 of file ZDCTask.h.

std::map<std::string,MonitorElement*> ZDCTask::_cADC_vs_TS_EChannel
protected

Definition at line 46 of file ZDCTask.h.

MonitorElement* ZDCTask::_cShape
protected

Definition at line 50 of file ZDCTask.h.

std::map<std::string,MonitorElement*> ZDCTask::_cShape_EChannel
protected

Definition at line 44 of file ZDCTask.h.

double ZDCTask::_cut
protected

Definition at line 39 of file ZDCTask.h.

int ZDCTask::_ped
protected

Definition at line 40 of file ZDCTask.h.

edm::InputTag ZDCTask::_tagQIE10
protected

Definition at line 35 of file ZDCTask.h.

edm::EDGetTokenT<ZDCDigiCollection> ZDCTask::_tokQIE10
protected

Definition at line 36 of file ZDCTask.h.

tuple ZDCTask.zdcTask
Initial value:
1 = cms.EDAnalyzer(
2  "ZDCTask",
3 
4  # standard
5  name = cms.untracked.string("ZDCTask"),
6  debug = cms.untracked.int32(0),
7  runkeyVal = cms.untracked.int32(0),
8  runkeyName = cms.untracked.string("pp_run"),
9 
10  # tag
11  tagQIE10 = cms.untracked.InputTag("castorDigis"),
12 
13  # cuts,
14  cut = cms.untracked.double(20),
15  ped = cms.untracked.int32(4)
16 )

Definition at line 3 of file ZDCTask.py.