95 for (
int row=0; row<14; row++){
123 castorDigiHists.meDigi_pulseBX =
m_dbe->
book1D(
"CASTOR average pulse in bunch crossings",
"CASTOR average pulse in bunch crossings", 3600, -0.5, 3600);
125 h_meDigi_pulseBX->GetXaxis()->SetTitle(
"orbit");
129 for(
int i=0;
i<16;
i++)
131 sprintf(name,
"Castor Pulse Shape for sector=%d (in all 14 modules)",
i+1);
163 if(
fVerbosity>0)
std::cout <<
"CastorPSMonitor::beginRun - NO DQMStore service" << std::endl;
178 if(
fVerbosity>0)
std::cout <<
"CastorPSMonitor::processEvent => DQMStore not instantiated !!!"<<std::endl;
195 for (
int i=0;
i<14;
i++){
196 for (
int k=0;
k<16;
k++){
197 if(
fVerbosity>1)
std::cout<<
"module:"<<
i+1<<
" sector:"<<
k+1<<
" Sigma=" << PedSigmaInChannel[
i][
k] << std::endl;
200 for (std::vector<HcalGenericDetId>::const_iterator it = listEMap.begin(); it != listEMap.end(); it++)
203 if(mygenid.isHcalCastorDetId())
207 myBunch.
detid = chanid;
211 for(
int i = 0;
i != 20;
i++)
215 myBunch.
tsfC[
i] = 0.0;
225 if(castorDigis.
size()>0) {
229 std::vector<NewBunch>::iterator bunch_it;
231 bool firstDigi =
true;
232 bool saturated =
false;
239 if ( lastTS+1 > digi.
size() ) lastTS = digi.
size()-1;
241 if(bunch_it->detid.rawId() == digi.
id().
rawId())
break;
242 bunch_it->usedflag =
true;
252 if ( lastTS+1 > digi.
size() ) lastTS = digi.
size()-1;
258 double sumDigi=0.;
double sumDigiADC=0.;
int bxTS=-9999; saturated =
false;
261 for(
int ts = firstTS; ts != lastTS+1; ts++)
265 if ( bxTS < 0 ) bxTS += 3563;
266 bxTS = ( bxTS % 3563 ) + 1;
272 bunch_it->tsAdc[ts] = digi.
sample(ts).
adc();
280 castorDigiHists.meDigi_pulseBX->Fill(static_cast<double>(bxTS),(bunch_it->tsfC[ts])/224.);
284 PSsector[bunch_it->detid.sector()-1]->Fill(10*(bunch_it->detid.module()-1)+ts, bunch_it->tsfC[ts]/
double(
ievt_));
288 sumDigi += bunch_it->tsfC[ts];
290 sumDigiADC += bunch_it->tsAdc[ts];
293 if(bunch_it->tsAdc[ts]>126.95) {
296 std::cout<<
"WARNING: ==> Module:" << bunch_it->detid.module() <<
" Sector:" << bunch_it->detid.sector() <<
" SATURATED !!! in TS:"<< ts <<std::endl;
305 if(saturated)
saturatedMap[bunch_it->detid.module()-1][bunch_it->detid.sector()-1] += 1;
308 DigiOccupancyMap->
Fill(bunch_it->detid.module()-1,bunch_it->detid.sector()-1, double(sumDigi/10));
312 std::cout<<
"==> Module:" << bunch_it->detid.module() <<
" Sector:" << bunch_it->detid.sector() << std::endl;
313 std::cout<<
"==> Total charge in fC:" << sumDigi << std::endl;
314 std::cout<<
"==> Total charge in ADC:" << sumDigiADC << std::endl;
334 for (
int sector=0; sector<16; sector++){
398 for (
int sector=16; sector<20; sector++){
404 for (
int sector=16; sector<20; sector++){
416 else {
if(
fVerbosity>0)
std::cout<<
"CastorPSMonitor::processEvent NO Castor Digis !!!"<<std::endl; }
std::vector< NewBunch > Bunches_
T getUntrackedParameter(std::string const &, T const &) const
virtual void setup(const edm::ParameterSet &ps, DQMStore *dbe)
TH2F * h_reportSummaryMap
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware) ...
MonitorElement * SaturationSummaryMap
void processEvent(const CastorDigiCollection &castorDigis, const CastorDbService &conditions, const std::vector< HcalGenericDetId > &listEMap, int iBunch, float PedSigmaInChannel[14][16])
MonitorElement * DigiOccupancyMap
int adc() const
get the ADC sample
const HcalQIESample & sample(int i) const
access a sample
std::vector< CastorDataFrame >::const_iterator const_iterator
void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup)
const CastorCalibrations & getCastorCalibrations(const HcalGenericDetId &fId) const
MonitorElement * reportSummary
MonitorElement * bookFloat(const char *name)
Book float.
double sumDigiForEachChannel[14][16]
uint32_t rawId() const
get the raw id
double saturatedThreshold_
const CastorQIEShape * getCastorShape() const
float charge(const CastorQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
double thirdRegionThreshold_
void setup(const edm::ParameterSet &ps, DQMStore *dbe)
MonitorElement * ChannelSummaryMap
double secondRegionThreshold_
double pedestal(int fCapId) const
get pedestal for capid=0..3
const_iterator end() const
struct CastorPSMonitor::@279 castorDigiHists
int capid() const
get the Capacitor id
double firstRegionThreshold_
MonitorElement * reportSummaryMap
MonitorElement * overallStatus
std::map< int, MonitorElement * > PSsector
TH2F * getTH2F(void) const
const HcalCastorDetId & id() const
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
int size() const
total number of samples in the digi
void setCurrentFolder(const std::string &fullpath)
const_iterator begin() const
const CastorQIECoder * getCastorCoder(const HcalGenericDetId &fId) const