Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
5255e37
Add new class SiPixelTopoFinder to handel the pixel topo used in SiPi…
tocheng Oct 23, 2020
2a63146
Update BuildFiles
tocheng Oct 24, 2020
45f4f20
update sipixelstatus dataformat for concurrent luminosity
tocheng Oct 25, 2020
e860395
Add just argument order
tocheng Oct 26, 2020
49cf0e0
Add Concurrency FW into BuildFile
tocheng Oct 26, 2020
6946b7a
change code structure from one::EDProducer to stream::EDProducer
tocheng Oct 26, 2020
9436663
Add GlobalCache SiPixelTopoCache to contain SiPixelTopoFinder
tocheng Oct 27, 2020
1892d57
Add explicit constructor and destructor for SiPixelTopoFinder
tocheng Oct 28, 2020
6e7c7e9
Add GlobalCache and RunCache to hold tracker(pixel) geo/topo related …
tocheng Oct 28, 2020
6168d24
Change SiPixelTopo get functions to be const because the globalBeginR…
tocheng Oct 29, 2020
042eb2c
implement accumulator to process events and endLumi summary and producer
tocheng Oct 31, 2020
224b7f1
change process name to be RECO
tocheng Oct 31, 2020
a41bd51
remove obselete parameter : number of lumi blocks to reset
tocheng Oct 31, 2020
ce6f359
Add missing FED-DetId map in sipixel topot finder
tocheng Nov 2, 2020
ac9f44e
Fix dumping SiPixelDetectorStatus to txt
tocheng Nov 2, 2020
9ff9b0e
Fix bug in sipixeltopo cache init; add debug option by dumping sipixe…
tocheng Nov 2, 2020
3514015
Remove obselete resetNlumi parameter from SiPixelCalZeroBias production
tocheng Nov 2, 2020
3e79516
turn off debug mode and update test production config
tocheng Nov 3, 2020
f63cc71
apply code checks
tocheng Nov 3, 2020
1f13f45
Apply code format checks
tocheng Nov 3, 2020
02e3094
Fix CLANG error
tocheng Nov 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions CalibTracker/SiPixelQuality/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="DataFormats/SiPixelDetId"/>
<use name="CondFormats/SiPixelObjects"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/DetId"/>
<use name="DataFormats/FEDRawData"/>
<use name="DataFormats/Provenance"/>
<use name="DataFormats/SiPixelCluster"/>
<use name="DataFormats/SiPixelDetId"/>
<use name="DataFormats/SiPixelDigi"/>
<use name="DataFormats/TrackerCommon"/>
<use name="DataFormats/TrackerRecHit2D"/>
<use name="DataFormats/TrackingRecHit"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="clhep"/>
<use name="root"/>
<use name="FWCore/ParameterSet"/>
<use name="Geometry/CommonDetUnit"/>
<use name="Geometry/CommonTopologies"/>
<use name="Geometry/TrackerGeometryBuilder"/>
<use name="rootcling"/>
<use name="rootrflx"/>
<export>
<lib name="1"/>
</export>

84 changes: 38 additions & 46 deletions CalibTracker/SiPixelQuality/interface/SiPixelDetectorStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,85 +13,77 @@ class SiPixelDetectorStatus {
SiPixelDetectorStatus();
~SiPixelDetectorStatus();

// reset
void resetDetectorStatus();
// combine detector status
void updateDetectorStatus(SiPixelDetectorStatus newData);

// file I/O
void readFromFile(std::string filename);
void dumpToFile(std::string filename);
void dumpToFile(std::ofstream& outFile);

/*|||||||||||||||||||||||||||||||||||||||||||||||||||||||*/

// add SiPixelModuleStatus for detID, specifying nrocs
void addModule(int detid, int nrocs);
// add a SiPixelModuleStatus obj for detID
void addModule(int detid, SiPixelModuleStatus a);
// get a Module
bool findModule(int detid);
SiPixelModuleStatus* getModule(int detid);

// fill hit in double idc in ROC roc into module detid
void fillDIGI(int detid, int roc);
// fill FEDerror25 info
void fillFEDerror25(int detid, PixelFEDChannel ch);

// detector status : std:map - collection of module status
std::map<int, SiPixelModuleStatus> getDetectorStatus() { return fModules_; }
// list of ROCs with FEDerror25
std::map<int, std::vector<int>> getFEDerror25Rocs();
// total number of DIGIs
unsigned long int digiOccDET() { return fDetHits_; }
// total processed events
void setNevents(unsigned long int N) { ftotalevents_ = N; }
unsigned long int getNevents() { return ftotalevents_; }

// number of modules in detector
int nmodules();
// determine detector average nhits and RMS
double perRocDigiOcc();
double perRocDigiOccVar();

unsigned long int digiOccDET() { return fDetHits; }

// number of modules in detector
int nmodules();

// get a Module
bool findModule(int detid);
SiPixelModuleStatus* getModule(int detid);

// provide for iterating over the entire detector
std::map<int, SiPixelModuleStatus>::iterator begin();
std::map<int, SiPixelModuleStatus>::iterator next();
std::map<int, SiPixelModuleStatus>::iterator end();

// set the time stamps
void setRunRange(int run0, int run1) {
fRun0 = run0;
fRun1 = run1;
fRun0_ = run0;
fRun1_ = run1;
}
std::pair<int, int> getRunRange() { return std::make_pair(fRun0, fRun1); }
std::pair<int, int> getRunRange() { return std::make_pair(fRun0_, fRun1_); }
//////////////////////////////////////////////////////////////////////////////////
void setLSRange(int ls0, int ls1) {
fLS0 = ls0;
fLS1 = ls1;
}
std::pair<int, int> getLSRange() { return std::make_pair(fLS0, fLS1); }

// total processed events
void setNevents(unsigned long int N) { fNevents = N; }
unsigned long int getNevents() { return fNevents; }

void resetDetectorStatus() {
fModules.clear();
fDetHits = 0;
fNevents = 0;
fRun0 = 99999999;
fRun1 = 0;
fLS0 = 99999999;
fLS1 = 0;
fLS0_ = ls0;
fLS1_ = ls1;
}
std::pair<int, int> getLSRange() { return std::make_pair(fLS0_, fLS1_); }

// combine detector status
void updateDetectorStatus(SiPixelDetectorStatus newData);

// detector status
std::map<int, SiPixelModuleStatus> getDetectorStatus() { return fModules; }
// provide for iterating over the entire detector
std::map<int, SiPixelModuleStatus>::iterator begin();
std::map<int, SiPixelModuleStatus>::iterator next();
std::map<int, SiPixelModuleStatus>::iterator end();

private:
std::map<int, SiPixelModuleStatus> fModules;
std::map<int, SiPixelModuleStatus> fModules_;

// first and last lumisection seen in this instance
int fLS0, fLS1;
// first and last run seen in this instance (should be the same number!)
int fRun0, fRun1;
int fLS0_, fLS1_;
// first and last run (should be the same number! as currently only perform Single Run Harvestor)
int fRun0_, fRun1_;

// number of events processed
unsigned long int fNevents;
unsigned long int ftotalevents_;

// total hits in detector
unsigned long int fDetHits;
unsigned long int fDetHits_;
};

#endif
21 changes: 13 additions & 8 deletions CalibTracker/SiPixelQuality/interface/SiPixelModuleStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,25 @@
// ----------------------------------------------------------------------
class SiPixelModuleStatus {
public:
SiPixelModuleStatus(int det = 0, int nrocs = 16);
SiPixelModuleStatus(int det = 0, int nrocs = 16); // default for Phase-1
~SiPixelModuleStatus();

/// fill with online coordinates
/// fill digi
void fillDIGI(int iroc);

/// fill with online coordinates (nhit > 1)
void updateDIGI(int iroc, unsigned int nhit);

/// fill FEDerror25
void fillFEDerror25(PixelFEDChannel ch);

/// update digi (nhit > 1)
void updateDIGI(int iroc, unsigned int nhit);
/// update FEDerror25
void updateFEDerror25(int iroc, bool FEDerror25);

/// return ROC status (= hits on ROC iroc)
unsigned int digiOccROC(int iroc);

/// return ROC FEDerror25
bool fedError25(int iroc);

/// return module status (= hits on module)
unsigned int digiOccMOD();

Expand All @@ -33,6 +37,7 @@ class SiPixelModuleStatus {
/// accessors and setters
int detid();
int nrocs();
void setDetId(int detid);
void setNrocs(int iroc);

/// calculate (averaged over this module's ROCs) mean hit number and its sigma
Expand All @@ -44,8 +49,8 @@ class SiPixelModuleStatus {
void updateModuleStatus(SiPixelModuleStatus newData);

private:
int fDetid, fNrocs;
std::vector<SiPixelRocStatus> fRocs;
int fDetid_, fNrocs_;
std::vector<SiPixelRocStatus> fRocs_;
};

#endif
10 changes: 6 additions & 4 deletions CalibTracker/SiPixelQuality/interface/SiPixelRocStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ class SiPixelRocStatus {
public:
SiPixelRocStatus();
~SiPixelRocStatus();

void fillDIGI();
void updateDIGI(unsigned int hits);
void fillFEDerror25();

// stuckTBM
bool isFEDerror25() { return isFEDerror25_; }
void updateDIGI(unsigned int hits);
void updateFEDerror25(bool fedError25);

// occpancy
unsigned int digiOccROC();
// FEDerror25 for stuckTBM
bool isFEDerror25();

private:
unsigned int fDC;
unsigned int fDC_;
bool isFEDerror25_;
};

Expand Down
72 changes: 72 additions & 0 deletions CalibTracker/SiPixelQuality/interface/SiPixelTopoFinder.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#ifndef SiPixelTopoFinder_H
#define SiPixelTopoFinder_H
// -*- C++ -*-
//
// Class: SiPixelTopoFinder
//
#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
#include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
#include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h"
#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h"
#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
#include "CondFormats/SiPixelObjects/interface/SiPixelFedCablingMap.h"

class SiPixelTopoFinder {
public:
SiPixelTopoFinder();
~SiPixelTopoFinder();

void init(const TrackerGeometry* trackerGeometry,
const TrackerTopology* trackerTopology,
const SiPixelFedCablingMap* siPixelFedCablingMap);

std::vector<int> getDetIds() const { return fDetIds_; }

std::map<int, std::pair<int, int>> getSensors() const { return fSensors_; }

std::map<int, std::pair<int, int>> getSensorLayout() const { return fSensorLayout_; }

std::unordered_map<uint32_t, unsigned int> getFedIds() const { return fFedIds_; }

std::map<int, std::map<int, int>> getRocIds() const { return fRocIds_; }

private:
// initialize with nullptr
int phase_ = -1;

const TrackerTopology* tkTopo_ = nullptr;
const TrackerGeometry* tkGeom_ = nullptr;
const SiPixelFedCablingMap* cablingMap_ = nullptr;

// List of <int> DetIds
std::vector<int> fDetIds_;
// ROC size (number of row, number of columns for each det id)
std::map<int, std::pair<int, int>> fSensors_;
// the roc layout on a module
std::map<int, std::pair<int, int>> fSensorLayout_;
// fedId as a function of detId
std::unordered_map<uint32_t, unsigned int> fFedIds_;
// map the index ROC to rocId
std::map<int, std::map<int, int>> fRocIds_;

// conversion between online(local, per-ROC) row/column and offline(global, per-Module) row/column
void onlineRocColRow(const DetId& detId,
const SiPixelFedCablingMap* cablingMap,
int fedId,
int offlineRow,
int offlineCol,
int& roc,
int& row,
int& col);

int indexROC(int irow, int icol, int nROCcolumns);

// some helper function for pixel naming
int quadrant(const DetId& detid);
int side(const DetId& detid);
int half(const DetId& detid);
};

#endif
60 changes: 42 additions & 18 deletions CalibTracker/SiPixelQuality/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
<use name="FWCore/Framework"/>
<use name="FWCore/ParameterSet"/>
<use name="DataFormats/DetId"/>
<use name="Geometry/TrackerGeometryBuilder"/>
<use name="Geometry/Records"/>
<use name="DataFormats/SiPixelDetId"/>
<use name="DataFormats/FEDRawData"/>
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/RunInfo"/>
<use name="CondFormats/SiPixelObjects"/>
<use name="DQM/SiPixelPhase1Common"/>
<use name="CalibTracker/SiPixelQuality"/>
<use name="root"/>
<library file="SiPixelStatusProducer.cc" name="SiPixelStatusProducer">
<flags EDM_PLUGIN="1"/>
<library name="SiPixelStatusProducer" file="SiPixelStatusProducer.cc">
<use name="CalibTracker/SiPixelQuality"/>
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/RunInfo"/>
<use name="CondFormats/SiPixelObjects"/>
<use name="DQM/SiPixelPhase1Common"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/DetId"/>
<use name="DataFormats/FEDRawData"/>
<use name="DataFormats/SiPixelCluster"/>
<use name="DataFormats/SiPixelDetId"/>
<use name="DataFormats/SiPixelDigi"/>
<use name="DataFormats/TrackerCommon"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/Utilities"/>
<use name="FWCore/Concurrency"/>
<use name="Geometry/CommonDetUnit"/>
<use name="Geometry/Records"/>
<use name="Geometry/TrackerGeometryBuilder"/>
<use name="rootcling"/>
<flags EDM_PLUGIN="1"/>
</library>

<library file="SiPixelStatusHarvester.cc" name="SiPixelStatusHarvester">
<flags EDM_PLUGIN="1"/>
<library name="SiPixelStatusHarvester" file="SiPixelStatusHarvester.cc">
<use name="CalibTracker/SiPixelQuality"/>
<use name="CondCore/DBOutputService"/>
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/SiPixelObjects"/>
<use name="DQM/SiPixelPhase1Common"/>
<use name="DQMServices/Core"/>
<use name="DataFormats/Common"/>
<use name="DataFormats/TrackerCommon"/>
<use name="FWCore/Framework"/>
<use name="FWCore/MessageLogger"/>
<use name="FWCore/ParameterSet"/>
<use name="FWCore/ServiceRegistry"/>
<use name="FWCore/Utilities"/>
<use name="Geometry/CommonDetUnit"/>
<use name="Geometry/Records"/>
<use name="Geometry/TrackerGeometryBuilder"/>
<use name="rootcling"/>
<flags EDM_PLUGIN="1"/>
</library>
Loading