Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing pixel cluster trend plots #15120

Merged
merged 3 commits into from Jul 19, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion DQM/SiPixelMonitorCluster/interface/SiPixelClusterModule.h
Expand Up @@ -57,7 +57,9 @@ class SiPixelClusterModule {
void book(const edm::ParameterSet& iConfig, const edm::EventSetup& iSetup, DQMStore::IBooker & iBooker, int type=0, bool twoD=true, bool reducedSet=false, bool isUpgrade=false);
/// Fill histograms
int fill(const edmNew::DetSetVector<SiPixelCluster> & input,
const TrackerGeometry* tracker,
const TrackerGeometry* tracker,
int *barrelClusterTotal,
int *endcapClusterTotal,
std::vector<MonitorElement*>& layers,
std::vector<MonitorElement*>& diskspz,
std::vector<MonitorElement*>& disksmz,
Expand Down
3 changes: 3 additions & 0 deletions DQM/SiPixelMonitorCluster/interface/SiPixelClusterSource.h
Expand Up @@ -101,6 +101,9 @@
std::vector<MonitorElement*> meClPosDiskpz;
std::vector<MonitorElement*> meClPosDiskmz;

MonitorElement* meClusBarrelProf;
MonitorElement* meClusEndcapProf;

int noOfLayers;
int noOfDisks;

Expand Down
14 changes: 8 additions & 6 deletions DQM/SiPixelMonitorCluster/src/SiPixelClusterModule.cc
Expand Up @@ -481,14 +481,15 @@ void SiPixelClusterModule::book(const edm::ParameterSet& iConfig, const edm::Eve
//
// Fill histograms
//
int SiPixelClusterModule::fill(const edmNew::DetSetVector<SiPixelCluster>& input, const TrackerGeometry* tracker,std::vector<MonitorElement*>& layers,std::vector<MonitorElement*>& diskspz,std::vector<MonitorElement*>& disksmz,bool modon, bool ladon, bool layon, bool phion, bool bladeon, bool diskon, bool ringon, bool twoD, bool reducedSet, bool smileyon, bool isUpgrade) {
int SiPixelClusterModule::fill(const edmNew::DetSetVector<SiPixelCluster>& input, const TrackerGeometry* tracker, int *barrelClusterTotal, int *endcapClusterTotal, std::vector<MonitorElement*>& layers,std::vector<MonitorElement*>& diskspz,std::vector<MonitorElement*>& disksmz,bool modon, bool ladon, bool layon, bool phion, bool bladeon, bool diskon, bool ringon, bool twoD, bool reducedSet, bool smileyon, bool isUpgrade) {

bool barrel = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelBarrel);
bool endcap = DetId(id_).subdetId() == static_cast<int>(PixelSubdetector::PixelEndcap);

edmNew::DetSetVector<SiPixelCluster>::const_iterator isearch = input.find(id_); // search clusters of detid
unsigned int numberOfClusters = 0;
unsigned int numberOfFpixClusters = 0;


if( isearch != input.end() ) { // Not an empty iterator

Expand All @@ -498,6 +499,8 @@ int SiPixelClusterModule::fill(const edmNew::DetSetVector<SiPixelCluster>& input
for(di = isearch->begin(); di != isearch->end(); di++) {
numberOfClusters++;
if(endcap) numberOfFpixClusters++;
if(endcap) (*endcapClusterTotal)++;
if(barrel) (*barrelClusterTotal)++;
float charge = 0.001*(di->charge()); // total charge of cluster
float x = di->x(); // barycenter x position
float y = di->y(); // barycenter y position
Expand All @@ -521,11 +524,11 @@ int SiPixelClusterModule::fill(const edmNew::DetSetVector<SiPixelCluster>& input
uint32_t DBlayer = PixelBarrelName(DetId(id_), pTT, isUpgrade).layerName();
if (!(DBlayer > layers.size()) && (layers[DBlayer-1])) layers[DBlayer-1]->Fill(clustgp.z(),clustgp.phi());
}else if(endcap){
uint32_t DBdisk = PixelEndcapName(DetId(id_), pTT, isUpgrade).diskName();
uint32_t DBdisk = PixelEndcapName(DetId(id_), pTT, isUpgrade).diskName();
if(clustgp.z()>0){
if (!(DBdisk > diskspz.size()) && (diskspz[DBdisk-1])) diskspz[DBdisk-1]->Fill(clustgp.x(),clustgp.y());
if (!(DBdisk > diskspz.size()) && (diskspz[DBdisk-1])) diskspz[DBdisk-1]->Fill(clustgp.x(),clustgp.y());
}else{
if (!(DBdisk > disksmz.size()) && (disksmz[DBdisk-1])) disksmz[DBdisk-1]->Fill(clustgp.x(),clustgp.y());
if (!(DBdisk > disksmz.size()) && (disksmz[DBdisk-1])) disksmz[DBdisk-1]->Fill(clustgp.x(),clustgp.y());
}
}
if(!reducedSet)
Expand Down Expand Up @@ -667,8 +670,7 @@ int SiPixelClusterModule::fill(const edmNew::DetSetVector<SiPixelCluster>& input
if(phion && barrel) (meNClustersPhi_)->Fill((float)numberOfClusters);
if(bladeon && endcap) (meNClustersBlade_)->Fill((float)numberOfClusters);
if(diskon && endcap) (meNClustersDisk_)->Fill((float)numberOfClusters);
if(ringon && endcap) (meNClustersRing_)->Fill((float)numberOfClusters);

if(ringon && endcap) (meNClustersRing_)->Fill((float)numberOfClusters);


}
Expand Down
29 changes: 27 additions & 2 deletions DQM/SiPixelMonitorCluster/src/SiPixelClusterSource.cc
Expand Up @@ -132,6 +132,20 @@ void SiPixelClusterSource::bookHistograms(DQMStore::IBooker & iBooker, edm::Run
ss2.str(std::string()); ss2 << "Clusters -Z Disk" << i << ";Global X (cm);Global Y (cm)";
meClPosDiskmz.push_back(iBooker.book2D(ss1.str(),ss2.str(),80,-20.,20.,80,-20.,20.));
}

//Book trend cluster plots for barrel and endcap. Lumisections for offline and second for online - taken from strips
iBooker.setCurrentFolder(topFolderName_+"/Barrel");
ss1.str(std::string()); ss1 << "totalNumberOfClustersProfile_siPixelClusters_Barrel";
ss2.str(std::string()); ss2 << "Total number of barrel clusters profile;Lumisection;";
meClusBarrelProf = iBooker.bookProfile(ss1.str(),ss2.str(),2400,0.,150,0,0,"");
meClusBarrelProf->getTH1()->SetCanExtend(TH1::kAllAxes);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible not to use SetCanExtend? It does cause performance problems. And who knows what other issues in the future.

Copy link
Contributor

@dmitrijus dmitrijus Jul 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already had this discussion in 81x... sorry.


iBooker.setCurrentFolder(topFolderName_+"/Endcap");
ss1.str(std::string()); ss1 << "totalNumberOfClustersProfile_siPixelClusters_Endcap";
ss2.str(std::string()); ss2 << "Total number of endcap clusters profile;Lumisection;";
meClusEndcapProf = iBooker.bookProfile(ss1.str(),ss2.str(),2400,0.,150,0,0,"");
meClusEndcapProf->getTH1()->SetCanExtend(TH1::kAllAxes);

}

//------------------------------------------------------------------
Expand Down Expand Up @@ -164,11 +178,14 @@ void SiPixelClusterSource::analyze(const edm::Event& iEvent, const edm::EventSet
int lumiSection = (int)iEvent.luminosityBlock();
int nEventFpixClusters = 0;

int nEventsBarrel = 0;
int nEventsEndcap = 0;

std::map<uint32_t,SiPixelClusterModule*>::iterator struct_iter;
for (struct_iter = thePixelStructure.begin() ; struct_iter != thePixelStructure.end() ; struct_iter++) {

int numberOfFpixClusters = (*struct_iter).second->fill(*input, tracker,
int numberOfFpixClusters = (*struct_iter).second->fill(*input, tracker,
&nEventsBarrel, &nEventsEndcap,
meClPosLayer,
meClPosDiskpz,
meClPosDiskmz,
Expand All @@ -184,8 +201,16 @@ void SiPixelClusterSource::analyze(const edm::Event& iEvent, const edm::EventSet
bigFpixClusterEventRate->Fill(lumiSection,1./23.);
}
}

float trendVar = iEvent.orbitNumber()/262144.0; //lumisection : seconds - matches strip trend plot

meClusBarrelProf->Fill(trendVar,nEventsBarrel);
meClusEndcapProf->Fill(trendVar,nEventsEndcap);

//std::cout<<"nEventFpixClusters: "<<nEventFpixClusters<<" , nLumiSecs: "<<nLumiSecs<<" , nBigEvents: "<<nBigEvents<<std::endl;



// slow down...
if(slowDown) usleep(10000);

Expand Down Expand Up @@ -270,7 +295,7 @@ void SiPixelClusterSource::bookMEs(DQMStore::IBooker & iBooker, const edm::Event


std::map<uint32_t,SiPixelClusterModule*>::iterator struct_iter;

SiPixelFolderOrganizer theSiPixelFolder(false);

for(struct_iter = thePixelStructure.begin(); struct_iter != thePixelStructure.end(); struct_iter++){
Expand Down