CMS 3D CMS Logo

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

#include <PixelLumi/PixelLumiDQM/plugins/PixelLumiDQM.h>

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

Classes

class  PixelClusterCount
 

Public Member Functions

 PixelLumiDQM (const edm::ParameterSet &)
 
 ~PixelLumiDQM ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 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 (const std::string &iProcessName, std::vector< const char * > &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 ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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)
 

Static Public Attributes

static double CM2_TO_NANOBARN = 1.0/1.e-33
 
static double FREQ_ORBIT = 11245.5
 
static const unsigned int lastBunchCrossing = 3564
 
static double rXSEC_PIXEL_CLUSTER = 9.4e-24
 
static double rXSEC_PIXEL_CLUSTER_UNC = 0.119e-24
 
static double SECONDS_PER_LS = double(0x40000)/double(FREQ_ORBIT)
 
static double XSEC_PIXEL_CLUSTER = 10.08e-24
 
static double XSEC_PIXEL_CLUSTER_UNC = 0.17e-24
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
unsigned int calculateBunchMask (MonitorElement *, std::vector< bool > &)
 
unsigned int calculateBunchMask (std::vector< float > &, unsigned int, std::vector< bool > &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endRun (edm::Run const &, edm::EventSetup const &)
 

Private Attributes

std::vector< bool > bunchTriggerMask
 
UInt_t fBXNo
 
Double_t fChi2
 
std::vector< uint32_t > fDeadModules
 
UInt_t fEvtNo
 
unsigned int fFillNumber
 
MonitorElementfHistBunchCrossings
 
MonitorElementfHistBunchCrossingsLastLumi
 
MonitorElementfHistClusByLS
 
MonitorElementfHistClusterCountByBxCumulative
 
MonitorElementfHistClusterCountByBxLastLumi
 
std::map< std::string,
MonitorElement * > 
fHistContainerThisRun
 
MonitorElementfHistnBClusVsLS [3]
 
MonitorElementfHistnFMClusVsLS [2]
 
MonitorElementfHistnFPClusVsLS [2]
 
MonitorElementfHistRecordedByBxCumulative
 
MonitorElementfHistRecordedByBxLastLumi
 
MonitorElementfHistTotalRecordedLumiByLS
 
unsigned int filledAndUnmaskedBunches
 
bool fIncludePixelClusterInfo
 
bool fIncludePixelQualCheckHistos
 
bool fIncludeVertexInfo
 
MonitorElementfIntActiveCrossingsFromDB
 
std::string fLogFileName_
 
UInt_t fLSNo
 
double fMinClusterCharge
 
int fMinPixelsPerCluster
 
Double_t fNdof
 
std::map< int, PixelClusterCountfNumPixelClusters
 
UInt_t fNumTrkPerVtx
 
UInt_t fNumVtx
 
UInt_t fNumVtxGood
 
edm::EDGetTokenT
< edmNew::DetSetVector
< SiPixelCluster > > 
fPixelClusterLabel
 
int fResetIntervalInLumiSections
 
UInt_t fRunNo
 
UInt_t fTimestamp
 
Double_t fVtxX
 
Double_t fVtxY
 
Double_t fVtxZ
 
std::ofstream logFile_
 
bool useInnerBarrelLayer
 

Static Private Attributes

static size_t const kNumDisks = 2
 
static size_t const kNumLayers = 3
 

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
 
- 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

Description: DQM Module producing Pixel Cluster Count Luminosity

Implementation notes: 1) Filling scheme is put in by 'hand' for now. Can obtain it from the cluster count but need higher rate in trigger; Best would be to have filling scheme in the DB. 2) Afterglow correction is put in by hand. 3) Currently barrel layer 0 is excluded, but a version using all pixel layers and disks is also in place. 4) A stable beam flag should be obtained from the DB to turn on actual checks. (Pixel Lumi does not make sense outside stable beams.) 5) Need a top module to correlate the info from the three trigger categories. NB: at present the module only uses the ZeroBias trigger providing about 85 Hz.

Definition at line 38 of file PixelLumiDQM.h.

Constructor & Destructor Documentation

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

Definition at line 46 of file PixelLumiDQM.cc.

References fDeadModules, fIncludePixelClusterInfo, fIncludePixelQualCheckHistos, fMinClusterCharge, fMinPixelsPerCluster, edm::ParameterSet::getUntrackedParameter(), and HLT_25ns14e33_v1_cff::InputTag.

46  :
48  edm::InputTag("siPixelClusters")))),
49  fIncludePixelClusterInfo(iConfig.getUntrackedParameter<bool>("includePixelClusterInfo", true)),
50  fIncludePixelQualCheckHistos(iConfig.getUntrackedParameter<bool>("includePixelQualCheckHistos", true)),
51  fResetIntervalInLumiSections(iConfig.getUntrackedParameter<int>("resetEveryNLumiSections", 1)),
52  fDeadModules(iConfig.getUntrackedParameter<std::vector<uint32_t> >("deadModules", std::vector<uint32_t>())),
53  fMinPixelsPerCluster(iConfig.getUntrackedParameter<int>("minNumPixelsPerCluster", 0)),
54  fMinClusterCharge(iConfig.getUntrackedParameter<double>("minChargePerCluster", 0)),
57  useInnerBarrelLayer(iConfig.getUntrackedParameter<bool>("useInnerBarrelLayer", false)),
58  fLogFileName_(iConfig.getUntrackedParameter<std::string>("logFileName","/tmp/pixel_lumi.txt"))
59 {
60  edm::LogInfo("Configuration")
61  << "PixelLumiDQM looking for pixel clusters in '"
62  << iConfig.getUntrackedParameter<edm::InputTag>("pixelClusterLabel",
63  edm::InputTag("siPixelClusters")) << "'";
64  edm::LogInfo("Configuration")
65  << "PixelLumiDQM storing pixel cluster info? "
67  edm::LogInfo("Configuration")
68  << "PixelLumiDQM storing pixel cluster quality check histograms? "
70 
71  if (!fDeadModules.size()) {
72  edm::LogInfo("Configuration")
73  << "No pixel modules specified to be ignored";
74  } else {
75  edm::LogInfo("Configuration")
76  << fDeadModules.size() << " pixel modules specified to be ignored:";
77  for (std::vector<uint32_t>::const_iterator it = fDeadModules.begin();
78  it != fDeadModules.end(); ++it) {
79  edm::LogInfo("Configuration")
80  << " " << *it;
81  }
82  }
83  edm::LogInfo("Configuration")
84  << "Ignoring pixel clusters with less than "
85  << fMinPixelsPerCluster << " pixels";
86  edm::LogInfo("Configuration")
87  << "Ignoring pixel clusters with charge less than "
89 }
bool fIncludePixelQualCheckHistos
Definition: PixelLumiDQM.h:134
T getUntrackedParameter(std::string const &, T const &) const
unsigned int filledAndUnmaskedBunches
Definition: PixelLumiDQM.h:167
static const unsigned int lastBunchCrossing
Definition: PixelLumiDQM.h:53
std::vector< uint32_t > fDeadModules
Definition: PixelLumiDQM.h:141
int fResetIntervalInLumiSections
Definition: PixelLumiDQM.h:135
bool useInnerBarrelLayer
Definition: PixelLumiDQM.h:168
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fPixelClusterLabel
Definition: PixelLumiDQM.h:115
double fMinClusterCharge
Definition: PixelLumiDQM.h:149
std::vector< bool > bunchTriggerMask
Definition: PixelLumiDQM.h:166
bool fIncludePixelClusterInfo
Definition: PixelLumiDQM.h:133
std::string fLogFileName_
Definition: PixelLumiDQM.h:170
int fMinPixelsPerCluster
Definition: PixelLumiDQM.h:146
PixelLumiDQM::~PixelLumiDQM ( )

Definition at line 92 of file PixelLumiDQM.cc.

93 {
94 }

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 106 of file PixelLumiDQM.cc.

References assert(), edmNew::DetSetVector< T >::begin(), edm::EventBase::bunchCrossing(), RecoTauCleanerPlugins::charge, compareJSON::const, edmNew::DetSetVector< T >::end(), edm::EventID::event(), fBXNo, fDeadModules, fEvtNo, fHistBunchCrossings, fHistBunchCrossingsLastLumi, fHistContainerThisRun, MonitorElement::Fill(), fIncludePixelClusterInfo, fIncludePixelQualCheckHistos, spr::find(), fLSNo, fMinClusterCharge, fMinPixelsPerCluster, fNumPixelClusters, fPixelClusterLabel, fRunNo, fTimestamp, edm::EventSetup::get(), edm::Event::getByToken(), edm::Event::getLuminosityBlock(), i, edm::EventBase::id(), GeomDetEnumerators::isTrackerPixel(), PixelBarrelName::layerName(), Topology::localPosition(), edm::LuminosityBlockBase::luminosityBlock(), PixelEndcapName::mI, PixelEndcapName::mO, PV3DBase< T, PVType, FrameType >::phi(), PixelEndcapName::pI, PixelSubdetector::PixelBarrel, HLT_25ns14e33_v1_cff::pixelClusters, PixelSubdetector::PixelEndcap, PixelEndcapName::pO, edm::EventID::run(), findQualityFiles::size, PixelGeomDetUnit::specificTopology(), mathSSE::sqrt(), DetId::subdetId(), GeomDet::surface(), edm::EventBase::time(), Surface::toGlobal(), edm::Timestamp::unixTime(), x, PV3DBase< T, PVType, FrameType >::x(), y, PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

108 {
109  // Collect all bookkeeping information.
110  fRunNo = iEvent.id().run();
111  fEvtNo = iEvent.id().event();
113  fBXNo = iEvent.bunchCrossing();
114  fTimestamp = iEvent.time().unixTime();
115  fHistBunchCrossings->Fill(float(fBXNo));
117  // This serves as event counter to compute luminosity from cluster counts.
118  std::map<int, PixelClusterCount>::iterator it = fNumPixelClusters.find(fBXNo);
119  if(it==fNumPixelClusters.end()) fNumPixelClusters[fBXNo] = PixelClusterCount();
120 
122  // Find tracker geometry.
124  iSetup.get<TrackerDigiGeometryRecord>().get(trackerGeo);
125 
126  // Find pixel clusters.
128  iEvent.getByToken(fPixelClusterLabel, pixelClusters);
129 
130  // Loop over entire tracker geometry.
131  for (TrackerGeometry::DetContainer::const_iterator
132  i = trackerGeo->dets().begin();
133  i != trackerGeo->dets().end(); ++i) {
134  // See if this is a pixel unit(?).
135 
136  if ( GeomDetEnumerators::isTrackerPixel((*i)->subDetector())) {
137  DetId detId = (*i)->geographicalId();
138  // Find all clusters on this detector module.
140  pixelClusters->find(detId);
141  if (iSearch != pixelClusters->end()) {
142 
143  // Count the number of clusters with at least a minimum
144  // number of pixels per cluster and at least a minimum charge.
145  size_t numClusters = 0;
147  itClus = iSearch->begin();
148  itClus != iSearch->end(); ++itClus) {
149  if ((itClus->size() >= fMinPixelsPerCluster) &&
150  (itClus->charge() >= fMinClusterCharge)) {
151  ++numClusters;
152  }
153  }
154  // DEBUG DEBUG DEBUG
155  assert(numClusters <= iSearch->size());
156  // DEBUG DEBUG DEBUG end
157 
158  // Add up the cluster count based on the position of this detector element.
159  if (detId.subdetId() == PixelSubdetector::PixelBarrel) {
160  PixelBarrelName detName = PixelBarrelName(detId);
161  int layer = detName.layerName();
162  fNumPixelClusters[fBXNo].numB.at(layer - 1) += numClusters;
163  fNumPixelClusters[fBXNo].dnumB.at(layer - 1) += sqrt(numClusters);
164  } else {
165  // DEBUG DEBUG DEBUG
167  // DEBUG DEBUG DEBUG end
168 
169  PixelEndcapName detName = PixelEndcapName(detId);
170  PixelEndcapName::HalfCylinder halfCylinder = detName.halfCylinder();
171  int disk = detName.diskName();
172  switch (halfCylinder) {
173  case PixelEndcapName::mO:
174  case PixelEndcapName::mI:
175  fNumPixelClusters[fBXNo].numFM.at(disk - 1) += numClusters;
176  fNumPixelClusters[fBXNo].dnumFM.at(disk - 1) += sqrt(numClusters);
177  break;
178  case PixelEndcapName::pO:
179  case PixelEndcapName::pI:
180  fNumPixelClusters[fBXNo].numFP.at(disk - 1) += numClusters;
181  fNumPixelClusters[fBXNo].dnumFP.at(disk - 1) += sqrt(numClusters);
182  break;
183  default:
184  assert(false);
185  break;
186  }
187  }
188  }
189  }
190  }
191  }
192  // ----------
193 
194  // Fill some pixel cluster quality check histograms if requested.
196 
197  // Find tracker geometry.
199  iSetup.get<TrackerDigiGeometryRecord>().get(trackerGeo);
200 
201  // Find pixel clusters.
203  iEvent.getByToken(fPixelClusterLabel, pixelClusters);
204 
205  bool filterDeadModules = (fDeadModules.size() > 0);
206  std::vector<uint32_t>::const_iterator deadModulesBegin = fDeadModules.begin();
207  std::vector<uint32_t>::const_iterator deadModulesEnd = fDeadModules.end();
208 
209  // Loop over entire tracker geometry.
210  for (TrackerGeometry::DetContainer::const_iterator
211  i = trackerGeo->dets().begin();
212  i != trackerGeo->dets().end(); ++i) {
213 
214  // See if this is a pixel module.
215  if ( GeomDetEnumerators::isTrackerPixel((*i)->subDetector())) {
216  DetId detId = (*i)->geographicalId();
217 
218  // Skip this module if it's on the list of modules to be ignored.
219  if (filterDeadModules &&
220  find(deadModulesBegin, deadModulesEnd, detId()) != deadModulesEnd) {
221  continue;
222  }
223 
224  // Find all clusters in this module.
226  pixelClusters->find(detId);
227 
228  // Loop over all clusters in this module.
229  if (iSearch != pixelClusters->end()) {
231  clus != iSearch->end(); ++clus) {
232 
233  if ((clus->size() >= fMinPixelsPerCluster) &&
234  (clus->charge() >= fMinClusterCharge)) {
235 
236  PixelGeomDetUnit const* theGeomDet =
237  dynamic_cast<PixelGeomDetUnit const*>(trackerGeo->idToDet(detId));
238  PixelTopology const* topol = &(theGeomDet->specificTopology());
239  double x = clus->x();
240  double y = clus->y();
241  LocalPoint clustLP = topol->localPosition(MeasurementPoint(x, y));
242  GlobalPoint clustGP = theGeomDet->surface().toGlobal(clustLP);
243  double charge = clus->charge() / 1.e3;
244  int size = clus->size();
245 
246  if (detId.subdetId() == PixelSubdetector::PixelBarrel) {
247  PixelBarrelName detName = PixelBarrelName(detId);
248  int layer = detName.layerName();
249  switch (layer) {
250  case 1:
251  fHistContainerThisRun["clusPosBarrel1"]->Fill(clustGP.z(), clustGP.phi());
252  fHistContainerThisRun["clusChargeBarrel1"]->Fill(iEvent.bunchCrossing(), charge);
253  fHistContainerThisRun["clusSizeBarrel1"]->Fill(iEvent.bunchCrossing(), size);
254  break;
255  case 2:
256  fHistContainerThisRun["clusPosBarrel2"]->Fill(clustGP.z(), clustGP.phi());
257  fHistContainerThisRun["clusChargeBarrel2"]->Fill(iEvent.bunchCrossing(), charge);
258  fHistContainerThisRun["clusSizeBarrel2"]->Fill(iEvent.bunchCrossing(), size);
259  break;
260  case 3:
261  fHistContainerThisRun["clusPosBarrel3"]->Fill(clustGP.z(), clustGP.phi());
262  fHistContainerThisRun["clusChargeBarrel3"]->Fill(iEvent.bunchCrossing(), charge);
263  fHistContainerThisRun["clusSizeBarrel3"]->Fill(iEvent.bunchCrossing(), size);
264  break;
265  default:
266  assert(false);
267  break;
268  }
269  } else {
270 
271  // DEBUG DEBUG DEBUG
273  // DEBUG DEBUG DEBUG end
274 
275  PixelEndcapName detName = PixelEndcapName(detId);
276  PixelEndcapName::HalfCylinder halfCylinder = detName.halfCylinder();
277  int disk = detName.diskName();
278  switch (halfCylinder) {
279  case PixelEndcapName::mO:
280  case PixelEndcapName::mI:
281  switch (disk) {
282  case 1:
283  fHistContainerThisRun["clusPosEndCapM1"]->Fill(clustGP.x(), clustGP.y());
284  fHistContainerThisRun["clusChargeEndCapM1"]->Fill(iEvent.bunchCrossing(), charge);
285  fHistContainerThisRun["clusSizeEndCapM1"]->Fill(iEvent.bunchCrossing(), size);
286  break;
287  case 2:
288  fHistContainerThisRun["clusPosEndCapM2"]->Fill(clustGP.x(), clustGP.y());
289  fHistContainerThisRun["clusChargeEndCapM2"]->Fill(iEvent.bunchCrossing(), charge);
290  fHistContainerThisRun["clusSizeEndCapM2"]->Fill(iEvent.bunchCrossing(), size);
291  break;
292  default:
293  assert(false);
294  break;
295  }
296  break;
297  case PixelEndcapName::pO:
298  case PixelEndcapName::pI:
299  switch (disk) {
300  case 1:
301  fHistContainerThisRun["clusPosEndCapP1"]->Fill(clustGP.x(), clustGP.y());
302  fHistContainerThisRun["clusChargeEndCapP1"]->Fill(iEvent.bunchCrossing(), charge);
303  fHistContainerThisRun["clusSizeEndCapP1"]->Fill(iEvent.bunchCrossing(), size);
304  break;
305  case 2:
306  fHistContainerThisRun["clusPosEndCapP2"]->Fill(clustGP.x(), clustGP.y());
307  fHistContainerThisRun["clusChargeEndCapP2"]->Fill(iEvent.bunchCrossing(), charge);
308  fHistContainerThisRun["clusSizeEndCapP2"]->Fill(iEvent.bunchCrossing(), size);
309  break;
310  default:
311  assert(false);
312  break;
313  }
314  break;
315  default:
316  assert(false);
317  break;
318  }
319  }
320  }
321  }
322  }
323  }
324  }
325  }
326 }
RunNumber_t run() const
Definition: EventID.h:39
bool fIncludePixelQualCheckHistos
Definition: PixelLumiDQM.h:134
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
EventNumber_t event() const
Definition: EventID.h:41
int i
Definition: DBlmapReader.cc:9
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const_iterator end(bool update=false) const
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
std::vector< uint32_t > fDeadModules
Definition: PixelLumiDQM.h:141
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
assert(m_qm.get())
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
int bunchCrossing() const
Definition: EventBase.h:66
data_type const * const_iterator
Definition: DetSetNew.h:30
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
void Fill(long long x)
LuminosityBlockNumber_t luminosityBlock() const
Measurement2DPoint MeasurementPoint
Measurement points are two-dimensional by default.
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > fPixelClusterLabel
Definition: PixelLumiDQM.h:115
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
unsigned int unixTime() const
Time in seconds since January 1, 1970.
Definition: Timestamp.h:46
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:79
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
double fMinClusterCharge
Definition: PixelLumiDQM.h:149
Definition: DetId.h:18
bool fIncludePixelClusterInfo
Definition: PixelLumiDQM.h:133
MonitorElement * fHistBunchCrossings
Definition: PixelLumiDQM.h:157
std::map< std::string, MonitorElement * > fHistContainerThisRun
Definition: PixelLumiDQM.h:137
MonitorElement * fHistBunchCrossingsLastLumi
Definition: PixelLumiDQM.h:158
const T & get() const
Definition: EventSetup.h:55
virtual const PixelTopology & specificTopology() const
Returns a reference to the pixel proxy topology.
int layerName() const
layer id
UInt_t fTimestamp
Definition: PixelLumiDQM.h:121
string const
Definition: compareJSON.py:14
bool isTrackerPixel(const GeomDetEnumerators::SubDetector m)
edm::EventID id() const
Definition: EventBase.h:60
std::map< int, PixelClusterCount > fNumPixelClusters
Definition: PixelLumiDQM.h:130
int fMinPixelsPerCluster
Definition: PixelLumiDQM.h:146
T x() const
Definition: PV3DBase.h:62
tuple size
Write out results.
edm::Timestamp time() const
Definition: EventBase.h:61
const_iterator begin(bool update=false) const
void PixelLumiDQM::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 489 of file PixelLumiDQM.cc.

References fHistBunchCrossingsLastLumi, fHistClusterCountByBxLastLumi, fHistRecordedByBxLastLumi, fResetIntervalInLumiSections, python.rootplot.utilities::ls(), edm::LuminosityBlockAuxiliary::luminosityBlock(), edm::LuminosityBlock::luminosityBlockAuxiliary(), and MonitorElement::Reset().

491 {
492  // Only reset and fill every fResetIntervalInLumiSections (default is 1 LS)
493  // Return unless the PREVIOUS LS was at the right modulo value
494  // (e.g. is resetinterval = 5 the rest will only be executed at LS=6
495  // NB: reset is done here so the histograms by LS are sent before resetting.
496  // NB: not being used for now since default is 1 LS. There is a bug here.
497 
498  unsigned int ls = lumiBlock.luminosityBlockAuxiliary().luminosityBlock();
499 
500  if((ls-1)%fResetIntervalInLumiSections==0){
504  }
505 }
int fResetIntervalInLumiSections
Definition: PixelLumiDQM.h:135
MonitorElement * fHistClusterCountByBxLastLumi
Definition: PixelLumiDQM.h:159
MonitorElement * fHistBunchCrossingsLastLumi
Definition: PixelLumiDQM.h:158
MonitorElement * fHistRecordedByBxLastLumi
Definition: PixelLumiDQM.h:163
void Reset(void)
reset ME (ie. contents, errors, etc)
void PixelLumiDQM::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  run,
edm::EventSetup const &   
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 329 of file PixelLumiDQM.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), fHistBunchCrossings, fHistBunchCrossingsLastLumi, fHistClusByLS, fHistClusterCountByBxCumulative, fHistClusterCountByBxLastLumi, fHistContainerThisRun, fHistnBClusVsLS, fHistnFMClusVsLS, fHistnFPClusVsLS, fHistRecordedByBxCumulative, fHistRecordedByBxLastLumi, fHistTotalRecordedLumiByLS, fIncludePixelQualCheckHistos, i, edm::RunBase::id(), relval_steps::key, kNumDisks, kNumLayers, lastBunchCrossing, mergeVDriftHistosByStation::name, Geom::pi(), edm::RunID::run(), edm::RunBase::run(), DQMStore::IBooker::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, and indexGen::title.

332 {
333  edm::LogInfo("Status") << "Starting processing of run #" << run.id().run();
334 
335  // Top folder containing high-level information about pixel and HF lumi.
336  std::string folder = "PixelLumi/";
337  ibooker.setCurrentFolder(folder);
338 
339  fHistTotalRecordedLumiByLS = ibooker.book1D("totalPixelLumiByLS","Pixel Lumi in nb vs LS",8000,0.5,8000.5);
340  fHistRecordedByBxCumulative = ibooker.book1D("PXLumiByBXsum","Pixel Lumi in nb by BX Cumulative vs LS",lastBunchCrossing,
341  0.5,float(lastBunchCrossing)+0.5);
342 
343  std::string subfolder = folder + "lastLS/";
344  ibooker.setCurrentFolder(subfolder);
345  fHistRecordedByBxLastLumi = ibooker.book1D("PXByBXLastLumi","Pixel By BX Last Lumi",lastBunchCrossing+1,
346  -0.5,float(lastBunchCrossing)+0.5);
347 
348  subfolder = folder+"ClusterCountingDetails/";
349  ibooker.setCurrentFolder(subfolder);
350 
351  fHistnBClusVsLS[0] = ibooker.book1D("nBClusVsLS_0","Fraction of Clusters vs LS Barrel layer 0",8000,0.5,8000.5);
352  fHistnBClusVsLS[1] = ibooker.book1D("nBClusVsLS_1","Fraction of Clusters vs LS Barrel layer 1",8000,0.5,8000.5);
353  fHistnBClusVsLS[2] = ibooker.book1D("nBClusVsLS_2","Fraction of Clusters vs LS Barrel layer 2",8000,0.5,8000.5);
354  fHistnFPClusVsLS[0] = ibooker.book1D("nFPClusVsLS_0","Fraction of Clusters vs LS Barrel layer 0",8000,0.5,8000.5);
355  fHistnFPClusVsLS[1] = ibooker.book1D("nFPClusVsLS_1","Fraction of Clusters vs LS Barrel layer 1",8000,0.5,8000.5);
356  fHistnFMClusVsLS[0] = ibooker.book1D("nFMClusVsLS_0","Fraction of Clusters vs LS Barrel layer 0",8000,0.5,8000.5);
357  fHistnFMClusVsLS[1] = ibooker.book1D("nFMClusVsLS_1","Fraction of Clusters vs LS Barrel layer 1",8000,0.5,8000.5);
358  fHistBunchCrossings = ibooker.book1D("BunchCrossings","Cumulative Bunch Crossings",lastBunchCrossing,
359  0.5,float(lastBunchCrossing)+0.5);
360  fHistBunchCrossingsLastLumi = ibooker.book1D("BunchCrossingsLL","Bunch Crossings Last Lumi",lastBunchCrossing,
361  0.5,float(lastBunchCrossing)+0.5);
362  fHistClusterCountByBxLastLumi = ibooker.book1D("ClusterCountByBxLL","Cluster Count by BX Last Lumi",lastBunchCrossing,
363  0.5,float(lastBunchCrossing)+0.5);
364  fHistClusterCountByBxCumulative = ibooker.book1D("ClusterCountByBxSum","Cluster Count by BX Cumulative",lastBunchCrossing,
365  0.5,float(lastBunchCrossing)+0.5);
366  fHistClusByLS = ibooker.book1D("totalClusByLS","Number of Clusters all dets vs LS",8000,0.5,8000.5);
367 
368  // Add some pixel cluster quality check histograms (in a subfolder).
369  subfolder = folder+"qualityChecks/";
370  ibooker.setCurrentFolder(subfolder);
371 
373  // Create histograms for this run if not already present in our list.
374  edm::LogInfo("Status") << "Creating histograms for run #" << run.id().run();
375 
376  // Pixel cluster positions in the barrel - (z, phi).
377  for (size_t i = 1; i <= kNumLayers; ++i) {
378  std::stringstream key;
379  key << "clusPosBarrel" << i;
380  std::stringstream name;
381  name << key.str() << "_" << run.run();
382  std::stringstream title;
383  title << "Pixel cluster position - barrel layer " << i;
384  fHistContainerThisRun[key.str()] = ibooker.book2D(name.str().c_str(),
385  title.str().c_str(),
386  100, -30., 30.,
387  64, -Geom::pi(), Geom::pi());
388  }
389 
390  // Pixel cluster positions in the endcaps (x, y).
391  std::vector<std::string> sides;
392  sides.push_back("M");
393  sides.push_back("P");
394  for (std::vector<std::string>::const_iterator side = sides.begin();
395  side != sides.end(); ++side) {
396  for (size_t i = 1; i <= kNumDisks; ++i) {
397  std::stringstream key;
398  key << "clusPosEndCap" << *side << i;
399  std::stringstream name;
400  name << key.str() << "_" << run.run();
401  std::stringstream title;
402  title << "Pixel cluster position - endcap disk " << i;
403  fHistContainerThisRun[key.str()] = ibooker.book2D(name.str().c_str(),
404  title.str().c_str(),
405  100, -20., 20.,
406  100, -20., 20.);
407  }
408  }
409 
410  // Pixel cluster charge in the barrel, per bx.
411  for (size_t i = 1; i <= kNumLayers; ++i) {
412  std::stringstream key;
413  key << "clusChargeBarrel" << i;
414  std::stringstream name;
415  name << key.str() << "_" << run.run();
416  std::stringstream title;
417  title << "Pixel cluster charge - barrel layer " << i;
418  fHistContainerThisRun[key.str()] = ibooker.book2D(name.str().c_str(),
419  title.str().c_str(),
420  3564, .5, 3564.5,
421  100, 0., 100.);
422  }
423 
424  // Pixel cluster charge in the endcaps, per bx.
425  for (std::vector<std::string>::const_iterator side = sides.begin();
426  side != sides.end(); ++side) {
427  for (size_t i = 1; i <= kNumDisks; ++i) {
428  std::stringstream key;
429  key << "clusChargeEndCap" << *side << i;
430  std::stringstream name;
431  name << key.str() << "_" << run.run();
432  std::stringstream title;
433  title << "Pixel cluster charge - endcap disk " << i;
434  fHistContainerThisRun[key.str()] = ibooker.book2D(name.str().c_str(),
435  title.str().c_str(),
436  3564, .5, 3564.5,
437  100, 0., 100.);
438  }
439  }
440 
441  // Pixel cluster size in the barrel, per bx.
442  for (size_t i = 1; i <= kNumLayers; ++i) {
443  std::stringstream key;
444  key << "clusSizeBarrel" << i;
445  std::stringstream name;
446  name << key.str() << "_" << run.run();
447  std::stringstream title;
448  title << "Pixel cluster size - barrel layer " << i;
449  fHistContainerThisRun[key.str()] = ibooker.book2D(name.str().c_str(),
450  title.str().c_str(),
451  3564, .5, 3564.5,
452  100, 0., 100.);
453  }
454 
455  // Pixel cluster size in the endcaps, per bx.
456  for (std::vector<std::string>::const_iterator side = sides.begin();
457  side != sides.end(); ++side) {
458  for (size_t i = 1; i <= kNumDisks; ++i) {
459  std::stringstream key;
460  key << "clusSizeEndCap" << *side << i;
461  std::stringstream name;
462  name << key.str() << "_" << run.run();
463  std::stringstream title;
464  title << "Pixel cluster size - endcap disk " << i;
465  fHistContainerThisRun[key.str()] = ibooker.book2D(name.str().c_str(),
466  title.str().c_str(),
467  3564, .5, 3564.5,
468  100, 0., 100.);
469  }
470  }
471  }
472 }
bool fIncludePixelQualCheckHistos
Definition: PixelLumiDQM.h:134
int i
Definition: DBlmapReader.cc:9
static const unsigned int lastBunchCrossing
Definition: PixelLumiDQM.h:53
MonitorElement * fHistRecordedByBxCumulative
Definition: PixelLumiDQM.h:164
MonitorElement * fHistClusByLS
Definition: PixelLumiDQM.h:161
MonitorElement * fHistnFMClusVsLS[2]
Definition: PixelLumiDQM.h:156
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * fHistClusterCountByBxLastLumi
Definition: PixelLumiDQM.h:159
MonitorElement * fHistTotalRecordedLumiByLS
Definition: PixelLumiDQM.h:162
MonitorElement * fHistClusterCountByBxCumulative
Definition: PixelLumiDQM.h:160
MonitorElement * fHistnBClusVsLS[3]
Definition: PixelLumiDQM.h:154
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * fHistBunchCrossings
Definition: PixelLumiDQM.h:157
std::map< std::string, MonitorElement * > fHistContainerThisRun
Definition: PixelLumiDQM.h:137
MonitorElement * fHistBunchCrossingsLastLumi
Definition: PixelLumiDQM.h:158
double pi()
Definition: Pi.h:31
MonitorElement * fHistRecordedByBxLastLumi
Definition: PixelLumiDQM.h:163
static size_t const kNumDisks
Definition: PixelLumiDQM.h:77
MonitorElement * fHistnFPClusVsLS[2]
Definition: PixelLumiDQM.h:155
static size_t const kNumLayers
Definition: PixelLumiDQM.h:76
unsigned int PixelLumiDQM::calculateBunchMask ( MonitorElement e,
std::vector< bool > &  mask 
)
private

Definition at line 678 of file PixelLumiDQM.cc.

References MonitorElement::getBinContent(), MonitorElement::getNbinsX(), i, and pileupCalc::nbins.

Referenced by endLuminosityBlock().

678  {
679  unsigned int nbins = e->getNbinsX();
680  std::vector<float> ar(nbins,0.);
681  for(unsigned int i = 1; i<= nbins; i++){
682  ar[i] = e->getBinContent(i);
683  }
684  return calculateBunchMask(ar,nbins,mask);
685 }
int i
Definition: DBlmapReader.cc:9
unsigned int calculateBunchMask(MonitorElement *, std::vector< bool > &)
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
unsigned int PixelLumiDQM::calculateBunchMask ( std::vector< float > &  e,
unsigned int  nbins,
std::vector< bool > &  mask 
)
private

Definition at line 686 of file PixelLumiDQM.cc.

References funct::abs(), newFWLiteAna::bin, gather_cfg::cout, i, timingPdfMaker::mean, and pileupCalc::nbins.

686  {
687  // Take the cumulative cluster count histogram and find max and average of non-empty bins.
688  unsigned int active_count = 0;
689  double maxc = 0.0;
690  double ave = 0.0; // Average of non-empty bins
691  unsigned int non_empty_bins = 0;
692 
693  for(unsigned int i = 1; i<= nbins; i++){
694  double bin = e[i];
695  if(bin !=0.0){
696  if(maxc<bin) maxc = bin;
697  ave += bin;
698  non_empty_bins++;
699  }
700  }
701 
702  ave /= non_empty_bins;
703  std::cout << "Bunch mask finder - non empty bins " << non_empty_bins
704  << " average of non empty bins " << ave
705  << " max content of one bin " << maxc << std::endl;
706  double mean = 0.;
707  double sigma = 0.;
708  if(non_empty_bins < 50){
709  mean = maxc;
710  sigma = (maxc)/20;
711  }
712  else{
713  TH1F dist("dist","dist",500,0.,maxc+(maxc/500.)*20.);
714  for(unsigned int i = 1; i<= nbins; i++){
715  double bin = e[i];
716  dist.Fill(bin);
717  }
718  dist.Fit("gaus","","",fmax(0.,ave-(maxc-ave)/5.),maxc);
719  TF1 *fit = dist.GetFunction("gaus");
720  mean = fit->GetParameter("Mean");
721  sigma = fit->GetParameter("Sigma");
722  }
723  std::cout << "Bunch mask will use mean" << mean << " sigma " << sigma << std::endl;
724  // Active BX defined as those which have nclus within fixed standard deviations of peak.
725  for(unsigned int i = 1; i<= nbins; i++){
726  double bin = e[i];
727  if(bin>0. && abs(bin-mean)<5.*(sigma)){ mask[i]=true; active_count++;}
728  }
729  std::cout << "Bunch mask finds " << active_count << " active bunch crossings " << std::endl;
730  // std::cout << "this is the full bx mask " ;
731  // for(unsigned int i = 1; i<= nbins; i++)
732  // std::cout << ((mask[i]) ? 1:0);
733  // std::cout << std::endl;
734  return active_count;
735 }
int i
Definition: DBlmapReader.cc:9
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
tuple cout
Definition: gather_cfg.py:121
void PixelLumiDQM::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 476 of file PixelLumiDQM.cc.

477 {
478 }
void PixelLumiDQM::endLuminosityBlock ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  es 
)
privatevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 510 of file PixelLumiDQM.cc.

References bunchTriggerMask, calculateBunchMask(), CM2_TO_NANOBARN, gather_cfg::cout, fHistBunchCrossingsLastLumi, fHistClusByLS, fHistClusterCountByBxCumulative, fHistClusterCountByBxLastLumi, fHistnBClusVsLS, fHistnFMClusVsLS, fHistnFPClusVsLS, fHistRecordedByBxCumulative, fHistRecordedByBxLastLumi, fHistTotalRecordedLumiByLS, filledAndUnmaskedBunches, fLogFileName_, fNumPixelClusters, FREQ_ORBIT, fResetIntervalInLumiSections, fRunNo, MonitorElement::getBinContent(), MonitorElement::getBinError(), i, lastBunchCrossing, logFile_, python.rootplot.utilities::ls(), edm::LuminosityBlockAuxiliary::luminosityBlock(), edm::LuminosityBlock::luminosityBlockAuxiliary(), rXSEC_PIXEL_CLUSTER, rXSEC_PIXEL_CLUSTER_UNC, SECONDS_PER_LS, MonitorElement::setBinContent(), MonitorElement::setBinError(), mathSSE::sqrt(), pileupDistInMC::total, estimatePileup_makeJSON::trunc, useInnerBarrelLayer, XSEC_PIXEL_CLUSTER, and XSEC_PIXEL_CLUSTER_UNC.

512 {
513 
514  unsigned int ls = lumiBlock.luminosityBlockAuxiliary().luminosityBlock();
515 
516  // Only fill every fResetIntervalInLumiSections (default is 1 LS)
517  if(ls%fResetIntervalInLumiSections!=0) return;
518 
519  printf("Lumi Block = %d\n",ls);
520 
521  if((ls-1)%fResetIntervalInLumiSections==0){
522  }
523 
524  unsigned int nBClus[3] = {0,0,0};
525  unsigned int nFPClus[2] = {0, 0};
526  unsigned int nFMClus[2] = {0, 0};
527 
528  double total_recorded = 0.;
529  double total_recorded_unc_square = 0.;
530 
531  // Obtain bunch-by-bunch cluster counts and compute totals for lumi calculation.
532  double totalcounts = 0.0;
533  double etotalcounts = 0.0;
534  double totalevents = 0.0;
535  double lumi_factor_per_bx = 0.0;
538  else
540 
541  for(std::map<int, PixelClusterCount>::iterator it = fNumPixelClusters.begin();
542  it != fNumPixelClusters.end(); it++) {
543 
544  // Sum all clusters for this BX.
545  unsigned int total = (*it).second.numB.at(1)+
546  (*it).second.numB.at(2)+(*it).second.numFP.at(0)+(*it).second.numFP.at(1)+
547  (*it).second.numFM.at(0)+(*it).second.numFM.at(1);
548  if(useInnerBarrelLayer) total+=(*it).second.numB.at(0);
549  totalcounts += total;
550  double etotal = (*it).second.dnumB.at(1)+
551  (*it).second.dnumB.at(2)+(*it).second.dnumFP.at(0)+(*it).second.dnumFP.at(1)+
552  (*it).second.dnumFM.at(0)+(*it).second.dnumFM.at(1);
553  if(useInnerBarrelLayer) etotal = (*it).second.dnumB.at(0);
554  etotalcounts += etotal;
555  etotal = sqrt(etotal);
556 
557  fHistClusterCountByBxLastLumi->setBinContent((*it).first,total);
558  fHistClusterCountByBxLastLumi->setBinError((*it).first,etotal);
560 
561  unsigned int events_per_bx = fHistBunchCrossingsLastLumi->getBinContent((*it).first);
562  totalevents += events_per_bx;
563  double average_cluster_count = events_per_bx !=0 ? double(total)/events_per_bx : 0.;
564  double average_cluster_count_unc = events_per_bx!=0 ? etotal/events_per_bx : 0.;
565  double pixel_bx_lumi_per_ls = lumi_factor_per_bx * average_cluster_count / CM2_TO_NANOBARN ;
566  double pixel_bx_lumi_per_ls_unc = 0.0;
568  pixel_bx_lumi_per_ls_unc = sqrt(lumi_factor_per_bx*lumi_factor_per_bx *
569  (average_cluster_count_unc*average_cluster_count_unc +
570  (average_cluster_count* XSEC_PIXEL_CLUSTER_UNC /
572  (average_cluster_count* XSEC_PIXEL_CLUSTER /
574  ) / CM2_TO_NANOBARN ;
575  else
576  pixel_bx_lumi_per_ls_unc = sqrt(lumi_factor_per_bx*lumi_factor_per_bx *
577  (average_cluster_count_unc*average_cluster_count_unc +
578  (average_cluster_count* rXSEC_PIXEL_CLUSTER_UNC /
580  (average_cluster_count* rXSEC_PIXEL_CLUSTER /
582  ) / CM2_TO_NANOBARN ;
583 
584  fHistRecordedByBxLastLumi->setBinContent((*it).first,pixel_bx_lumi_per_ls);
585  fHistRecordedByBxLastLumi->setBinError((*it).first,pixel_bx_lumi_per_ls_unc);
586 
589  pixel_bx_lumi_per_ls);
590 
591  /*
592  if(fHistRecordedByBxLastLumi->getBinContent((*it).first)!=0.)
593  fHistRecordedByBxLastLumi->getBinContent((*it).first));
594  if(fHistRecordedByBxCumulative->getBinContent((*it).first)!=0.)
595  fHistRecordedByBxCumulative->getBinContent((*it).first));
596  */
597 
598  nBClus[0] +=(*it).second.numB.at(0);
599  nBClus[1] +=(*it).second.numB.at(1);
600  nBClus[2] +=(*it).second.numB.at(2);
601  nFPClus[0] +=(*it).second.numFP.at(0);
602  nFPClus[1] +=(*it).second.numFP.at(1);
603  nFMClus[0] +=(*it).second.numFM.at(0);
604  nFMClus[1] +=(*it).second.numFM.at(1);
605 
606  // Reset counters
607  (*it).second.Reset();
608 
609  // std::cout << "bx="<< (*it).first << " clusters=" << (*it).second.numB.at(0)) << std::endl;
610  }
611 
613  for(unsigned int i = 0; i<= lastBunchCrossing; i++){
614  if(bunchTriggerMask[i]){
615  double err = fHistRecordedByBxLastLumi->getBinError(i);
616  total_recorded += fHistRecordedByBxLastLumi->getBinContent(i);
617  total_recorded_unc_square += err*err;
618  }
619  }
620 
621  // Replace the total obtained by summing over BXs with the average per BX from the total cluster count and rescale
622 
623  if(totalevents > 10){
624  total_recorded = lumi_factor_per_bx * totalcounts / totalevents / CM2_TO_NANOBARN ;
625  }
626  else total_recorded = 0.0;
627 
628  std::cout << " Total recorded " << total_recorded << std::endl;
629  fHistTotalRecordedLumiByLS->setBinContent(ls,total_recorded);
631  sqrt(total_recorded_unc_square));
632  }
633  // fill cluster counts by detector regions for sanity checks
634  unsigned int all_detectors_counts = 0;
635  for(unsigned int i = 0; i < 3; i++){
636  all_detectors_counts+=nBClus[i];
637  }
638  for(unsigned int i = 0; i < 2; i++){
639  all_detectors_counts+=nFPClus[i];
640  }
641  for(unsigned int i = 0; i < 2; i++){
642  all_detectors_counts+=nFMClus[i];
643  }
644 
645  fHistClusByLS->setBinContent(ls, all_detectors_counts);
646 
647  for(unsigned int i = 0; i < 3; i++){
649  float(nBClus[i])/float(all_detectors_counts));
650  }
651  for(unsigned int i = 0; i < 2; i++){
653  float(nFPClus[i])/float(all_detectors_counts));
654  }
655  for(unsigned int i = 0; i < 2; i++){
657  float(nFMClus[i])/float(all_detectors_counts));
658  }
659 
661 
662  timeval tv;
663  gettimeofday(&tv,0);
664  tm *ts = gmtime(&tv.tv_sec);
665  char datestring[256];
666  strftime(datestring, sizeof(datestring),"%Y.%m.%d %T GMT %s",ts);
667  logFile_ << "RunNumber "<< fRunNo << std::endl;
668  logFile_ << "EndTimeOfFit " << datestring << std::endl;
669  logFile_ << "LumiRange "<< ls << "-" << ls << std::endl;
670  logFile_ << "Fill "<< -99 << std::endl;
671  logFile_ << "ActiveBunchCrossings "<< filledAndUnmaskedBunches << std::endl;
672  logFile_ << "PixelLumi "<< fHistTotalRecordedLumiByLS->getBinContent(ls) * 0.98 << std::endl;
673  logFile_ << "HFLumi "<< -99 << std::endl;
674  logFile_ << "Ratio " << -99 << std::endl;
675  logFile_.close();
676 }
static double SECONDS_PER_LS
Definition: PixelLumiDQM.h:43
int i
Definition: DBlmapReader.cc:9
unsigned int filledAndUnmaskedBunches
Definition: PixelLumiDQM.h:167
void setBinContent(int binx, double content)
set content of bin (1-D)
static const unsigned int lastBunchCrossing
Definition: PixelLumiDQM.h:53
int fResetIntervalInLumiSections
Definition: PixelLumiDQM.h:135
MonitorElement * fHistRecordedByBxCumulative
Definition: PixelLumiDQM.h:164
bool useInnerBarrelLayer
Definition: PixelLumiDQM.h:168
MonitorElement * fHistClusByLS
Definition: PixelLumiDQM.h:161
MonitorElement * fHistnFMClusVsLS[2]
Definition: PixelLumiDQM.h:156
unsigned int calculateBunchMask(MonitorElement *, std::vector< bool > &)
static double rXSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:50
T sqrt(T t)
Definition: SSEVec.h:48
MonitorElement * fHistClusterCountByBxLastLumi
Definition: PixelLumiDQM.h:159
MonitorElement * fHistTotalRecordedLumiByLS
Definition: PixelLumiDQM.h:162
static double FREQ_ORBIT
Definition: PixelLumiDQM.h:42
static double XSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:47
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * fHistClusterCountByBxCumulative
Definition: PixelLumiDQM.h:160
MonitorElement * fHistnBClusVsLS[3]
Definition: PixelLumiDQM.h:154
std::vector< bool > bunchTriggerMask
Definition: PixelLumiDQM.h:166
static double CM2_TO_NANOBARN
Definition: PixelLumiDQM.h:52
static double XSEC_PIXEL_CLUSTER
Definition: PixelLumiDQM.h:46
double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
MonitorElement * fHistBunchCrossingsLastLumi
Definition: PixelLumiDQM.h:158
std::string fLogFileName_
Definition: PixelLumiDQM.h:170
static double rXSEC_PIXEL_CLUSTER_UNC
Definition: PixelLumiDQM.h:51
double getBinContent(int binx) const
get content of bin (1-D)
std::map< int, PixelClusterCount > fNumPixelClusters
Definition: PixelLumiDQM.h:130
MonitorElement * fHistRecordedByBxLastLumi
Definition: PixelLumiDQM.h:163
tuple cout
Definition: gather_cfg.py:121
MonitorElement * fHistnFPClusVsLS[2]
Definition: PixelLumiDQM.h:155
std::ofstream logFile_
Definition: PixelLumiDQM.h:172
void PixelLumiDQM::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
privatevirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 482 of file PixelLumiDQM.cc.

483 {
484 }
void PixelLumiDQM::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 98 of file PixelLumiDQM.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

98  {
100  desc.setUnknown();
101  descriptions.addDefault(desc);
102 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

std::vector<bool> PixelLumiDQM::bunchTriggerMask
private

Definition at line 166 of file PixelLumiDQM.h.

Referenced by endLuminosityBlock().

double PixelLumiDQM::CM2_TO_NANOBARN = 1.0/1.e-33
static

Definition at line 52 of file PixelLumiDQM.h.

Referenced by endLuminosityBlock().

UInt_t PixelLumiDQM::fBXNo
private

Definition at line 120 of file PixelLumiDQM.h.

Referenced by analyze().

Double_t PixelLumiDQM::fChi2
private

Definition at line 128 of file PixelLumiDQM.h.

std::vector<uint32_t> PixelLumiDQM::fDeadModules
private

Definition at line 141 of file PixelLumiDQM.h.

Referenced by analyze(), and PixelLumiDQM().

UInt_t PixelLumiDQM::fEvtNo
private

Definition at line 118 of file PixelLumiDQM.h.

Referenced by analyze().

unsigned int PixelLumiDQM::fFillNumber
private

Definition at line 169 of file PixelLumiDQM.h.

MonitorElement* PixelLumiDQM::fHistBunchCrossings
private

Definition at line 157 of file PixelLumiDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* PixelLumiDQM::fHistBunchCrossingsLastLumi
private

Definition at line 158 of file PixelLumiDQM.h.

Referenced by analyze(), beginLuminosityBlock(), bookHistograms(), and endLuminosityBlock().

MonitorElement* PixelLumiDQM::fHistClusByLS
private

Definition at line 161 of file PixelLumiDQM.h.

Referenced by bookHistograms(), and endLuminosityBlock().

MonitorElement* PixelLumiDQM::fHistClusterCountByBxCumulative
private

Definition at line 160 of file PixelLumiDQM.h.

Referenced by bookHistograms(), and endLuminosityBlock().

MonitorElement* PixelLumiDQM::fHistClusterCountByBxLastLumi
private

Definition at line 159 of file PixelLumiDQM.h.

Referenced by beginLuminosityBlock(), bookHistograms(), and endLuminosityBlock().

std::map<std::string, MonitorElement*> PixelLumiDQM::fHistContainerThisRun
private

Definition at line 137 of file PixelLumiDQM.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* PixelLumiDQM::fHistnBClusVsLS[3]
private

Definition at line 154 of file PixelLumiDQM.h.

Referenced by bookHistograms(), and endLuminosityBlock().

MonitorElement* PixelLumiDQM::fHistnFMClusVsLS[2]
private

Definition at line 156 of file PixelLumiDQM.h.

Referenced by bookHistograms(), and endLuminosityBlock().

MonitorElement* PixelLumiDQM::fHistnFPClusVsLS[2]
private

Definition at line 155 of file PixelLumiDQM.h.

Referenced by bookHistograms(), and endLuminosityBlock().

MonitorElement* PixelLumiDQM::fHistRecordedByBxCumulative
private

Definition at line 164 of file PixelLumiDQM.h.

Referenced by bookHistograms(), and endLuminosityBlock().

MonitorElement* PixelLumiDQM::fHistRecordedByBxLastLumi
private

Definition at line 163 of file PixelLumiDQM.h.

Referenced by beginLuminosityBlock(), bookHistograms(), and endLuminosityBlock().

MonitorElement* PixelLumiDQM::fHistTotalRecordedLumiByLS
private

Definition at line 162 of file PixelLumiDQM.h.

Referenced by bookHistograms(), and endLuminosityBlock().

unsigned int PixelLumiDQM::filledAndUnmaskedBunches
private

Definition at line 167 of file PixelLumiDQM.h.

Referenced by endLuminosityBlock().

bool PixelLumiDQM::fIncludePixelClusterInfo
private

Definition at line 133 of file PixelLumiDQM.h.

Referenced by analyze(), and PixelLumiDQM().

bool PixelLumiDQM::fIncludePixelQualCheckHistos
private

Definition at line 134 of file PixelLumiDQM.h.

Referenced by analyze(), bookHistograms(), and PixelLumiDQM().

bool PixelLumiDQM::fIncludeVertexInfo
private

Definition at line 132 of file PixelLumiDQM.h.

MonitorElement* PixelLumiDQM::fIntActiveCrossingsFromDB
private

Definition at line 153 of file PixelLumiDQM.h.

std::string PixelLumiDQM::fLogFileName_
private

Definition at line 170 of file PixelLumiDQM.h.

Referenced by endLuminosityBlock().

UInt_t PixelLumiDQM::fLSNo
private

Definition at line 119 of file PixelLumiDQM.h.

Referenced by analyze().

double PixelLumiDQM::fMinClusterCharge
private

Definition at line 149 of file PixelLumiDQM.h.

Referenced by analyze(), and PixelLumiDQM().

int PixelLumiDQM::fMinPixelsPerCluster
private

Definition at line 146 of file PixelLumiDQM.h.

Referenced by analyze(), and PixelLumiDQM().

Double_t PixelLumiDQM::fNdof
private

Definition at line 129 of file PixelLumiDQM.h.

std::map<int, PixelClusterCount> PixelLumiDQM::fNumPixelClusters
private

Definition at line 130 of file PixelLumiDQM.h.

Referenced by analyze(), and endLuminosityBlock().

UInt_t PixelLumiDQM::fNumTrkPerVtx
private

Definition at line 124 of file PixelLumiDQM.h.

UInt_t PixelLumiDQM::fNumVtx
private

Definition at line 122 of file PixelLumiDQM.h.

UInt_t PixelLumiDQM::fNumVtxGood
private

Definition at line 123 of file PixelLumiDQM.h.

edm::EDGetTokenT<edmNew::DetSetVector<SiPixelCluster> > PixelLumiDQM::fPixelClusterLabel
private

Definition at line 115 of file PixelLumiDQM.h.

Referenced by analyze().

double PixelLumiDQM::FREQ_ORBIT = 11245.5
static

Definition at line 42 of file PixelLumiDQM.h.

Referenced by endLuminosityBlock().

int PixelLumiDQM::fResetIntervalInLumiSections
private

Definition at line 135 of file PixelLumiDQM.h.

Referenced by beginLuminosityBlock(), and endLuminosityBlock().

UInt_t PixelLumiDQM::fRunNo
private

Definition at line 117 of file PixelLumiDQM.h.

Referenced by analyze(), and endLuminosityBlock().

UInt_t PixelLumiDQM::fTimestamp
private

Definition at line 121 of file PixelLumiDQM.h.

Referenced by analyze().

Double_t PixelLumiDQM::fVtxX
private

Definition at line 125 of file PixelLumiDQM.h.

Double_t PixelLumiDQM::fVtxY
private

Definition at line 126 of file PixelLumiDQM.h.

Double_t PixelLumiDQM::fVtxZ
private

Definition at line 127 of file PixelLumiDQM.h.

size_t const PixelLumiDQM::kNumDisks = 2
staticprivate

Definition at line 77 of file PixelLumiDQM.h.

Referenced by bookHistograms().

size_t const PixelLumiDQM::kNumLayers = 3
staticprivate

Definition at line 76 of file PixelLumiDQM.h.

Referenced by bookHistograms().

const unsigned int PixelLumiDQM::lastBunchCrossing = 3564
static

Definition at line 53 of file PixelLumiDQM.h.

Referenced by bookHistograms(), and endLuminosityBlock().

std::ofstream PixelLumiDQM::logFile_
private

Definition at line 172 of file PixelLumiDQM.h.

Referenced by endLuminosityBlock().

double PixelLumiDQM::rXSEC_PIXEL_CLUSTER = 9.4e-24
static

Definition at line 50 of file PixelLumiDQM.h.

Referenced by endLuminosityBlock().

double PixelLumiDQM::rXSEC_PIXEL_CLUSTER_UNC = 0.119e-24
static

Definition at line 51 of file PixelLumiDQM.h.

Referenced by endLuminosityBlock().

double PixelLumiDQM::SECONDS_PER_LS = double(0x40000)/double(FREQ_ORBIT)
static

Definition at line 43 of file PixelLumiDQM.h.

Referenced by endLuminosityBlock().

bool PixelLumiDQM::useInnerBarrelLayer
private

Definition at line 168 of file PixelLumiDQM.h.

Referenced by endLuminosityBlock().

double PixelLumiDQM::XSEC_PIXEL_CLUSTER = 10.08e-24
static

Definition at line 46 of file PixelLumiDQM.h.

Referenced by endLuminosityBlock().

double PixelLumiDQM::XSEC_PIXEL_CLUSTER_UNC = 0.17e-24
static

Definition at line 47 of file PixelLumiDQM.h.

Referenced by endLuminosityBlock().