Skip to content

Commit

Permalink
Merge pull request #1 from gem-sw/CMSSW_6_2_X_SLHC
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
clacaputo committed Feb 24, 2014
2 parents 5b87b17 + 62bacb8 commit e289b52
Show file tree
Hide file tree
Showing 119 changed files with 6,563 additions and 6,415 deletions.
3 changes: 2 additions & 1 deletion DQMServices/ClientConfig/interface/DQMGenericClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* $Revision: 1.10 $
*
* \author Junghwan Goh - SungKyunKwan University
* \modified Cesare Calabria - Università & INFN Bari
*/

#include "FWCore/Framework/interface/Frameworkfwd.h"
Expand Down Expand Up @@ -78,7 +79,7 @@ class DQMGenericClient : public edm::EDAnalyzer
void normalizeToEntries(const std::string& startDir, const std::string& histName, const std::string& normHistName);
void makeCumulativeDist(const std::string& startDir, const std::string& cdName);

void limitedFit(MonitorElement * srcME, MonitorElement * meanME, MonitorElement * sigmaME);
void limitedFit(MonitorElement * srcME, MonitorElement * meanME, MonitorElement * sigmaME, MonitorElement * rmsME);

private:
unsigned int verbose_;
Expand Down
4 changes: 4 additions & 0 deletions DQMServices/ClientConfig/interface/FitSlicesYTool.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* $Date: 2009/03/27 00:16:49 $
* $Revision: 1.1 $
* \author cerati
* \modified calabria
*/

#include <TH2F.h>
Expand All @@ -29,7 +30,10 @@ class FitSlicesYTool {
void getFittedMeanWithError(MonitorElement*);
/// Fill the ME with the sigma value (with error) of the gaussian fit in each slice
void getFittedSigmaWithError(MonitorElement*);
/// Fill the ME with the RMS value (with error) of each slice
void getRMS(MonitorElement*);
private:
TH2F* h2D;
TH1* h0;
TH1* h1;
TH1* h2;
Expand Down
19 changes: 15 additions & 4 deletions DQMServices/ClientConfig/plugins/DQMGenericClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* $Revision: 1.35 $
*
* \author Junghwan Goh - SungKyunKwan University
* \modified Cesare Calabria - Università & INFN Bari
*/

#include "DQMServices/ClientConfig/interface/DQMGenericClient.h"
Expand Down Expand Up @@ -594,12 +595,14 @@ void DQMGenericClient::computeResolution(const string& startDir, const string& n
float * lowedgesfloats = new float[nBin+1];
ME* meanME;
ME* sigmaME;
ME* rmsME;
if (hSrc->GetXaxis()->GetXbins()->GetSize())
{
for (int j=0; j<nBin+1; ++j)
lowedgesfloats[j] = (float)hSrc->GetXaxis()->GetXbins()->GetAt(j);
meanME = theDQM->book1D(newPrefix+"_Mean", titlePrefix+" Mean", nBin, lowedgesfloats);
sigmaME = theDQM->book1D(newPrefix+"_Sigma", titlePrefix+" Sigma", nBin, lowedgesfloats);
rmsME = theDQM->book1D(newPrefix+"_RMS", titlePrefix+" RMS", nBin, lowedgesfloats);
}
else
{
Expand All @@ -608,21 +611,26 @@ void DQMGenericClient::computeResolution(const string& startDir, const string& n
hSrc->GetXaxis()->GetXmax());
sigmaME = theDQM->book1D(newPrefix+"_Sigma", titlePrefix+" Sigma", nBin,
hSrc->GetXaxis()->GetXmin(),
hSrc->GetXaxis()->GetXmax());
hSrc->GetXaxis()->GetXmax());
rmsME = theDQM->book1D(newPrefix+"_RMS", titlePrefix+" RMS", nBin,
hSrc->GetXaxis()->GetXmin(),
hSrc->GetXaxis()->GetXmax());
}

if (meanME && sigmaME)
if (meanME && sigmaME && rmsME)
{
meanME->setEfficiencyFlag();
sigmaME->setEfficiencyFlag();
rmsME->setEfficiencyFlag();

if (! resLimitedFit_ ) {
FitSlicesYTool fitTool(srcME);
fitTool.getFittedMeanWithError(meanME);
fitTool.getFittedSigmaWithError(sigmaME);
//// fitTool.getFittedChisqWithError(chi2ME); // N/A
fitTool.getRMS(rmsME);
} else {
limitedFit(srcME,meanME,sigmaME);
limitedFit(srcME,meanME,sigmaME,rmsME);
}
}
delete[] lowedgesfloats;
Expand Down Expand Up @@ -730,7 +738,7 @@ void DQMGenericClient::makeCumulativeDist(const std::string& startDir, const std
return;
}

void DQMGenericClient::limitedFit(MonitorElement * srcME, MonitorElement * meanME, MonitorElement * sigmaME)
void DQMGenericClient::limitedFit(MonitorElement * srcME, MonitorElement * meanME, MonitorElement * sigmaME, MonitorElement * rmsME)
{
TH2F * histo = srcME->getTH2F();

Expand All @@ -745,6 +753,7 @@ void DQMGenericClient::limitedFit(MonitorElement * srcME, MonitorElement * meanM
TString iString(i);
TH1 *histoY = histo->ProjectionY(" ", i, i);
double cont = histoY->GetEntries();
double rms = histoY->GetRMS();

if (cont >= cont_min) {
float minfit = histoY->GetMean() - histoY->GetRMS();
Expand All @@ -770,6 +779,8 @@ void DQMGenericClient::limitedFit(MonitorElement * srcME, MonitorElement * meanM
// sigmaME->setBinEntries(i, 1.);
// sigmaME->setBinError(i,sqrt(err[2]*err[2]+par[2]*par[2]));

rmsME->setBinContent(i, rms);

if(fitFcn) delete fitFcn;
if(histoY) delete histoY;
}
Expand Down
15 changes: 15 additions & 0 deletions DQMServices/ClientConfig/src/FitSlicesYTool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ FitSlicesYTool::FitSlicesYTool(MonitorElement* me)
TH2F * h = me->getTH2F();
h->FitSlicesY();
string name(h->GetName());
h2D = (TH2F*)h->Clone();
h0 = (TH1*)gDirectory->Get((name+"_0").c_str());
h1 = (TH1*)gDirectory->Get((name+"_1").c_str());
h2 = (TH1*)gDirectory->Get((name+"_2").c_str());
Expand All @@ -29,6 +30,7 @@ FitSlicesYTool::FitSlicesYTool(MonitorElement* me)
// h3 = (TH1*)gDirectory->Get((name+"_chi2").c_str());
// }
FitSlicesYTool::~FitSlicesYTool(){
delete h2D;
delete h0;
delete h1;
delete h2;
Expand Down Expand Up @@ -80,3 +82,16 @@ void FitSlicesYTool::getFittedSigmaWithError(MonitorElement * me){
throw cms::Exception("FitSlicesYTool") << "Different number of bins!";
}
}
void FitSlicesYTool::getRMS(MonitorElement * me){
if (!(h2D&&me)) throw cms::Exception("FitSlicesYTool") << "Pointer =0 : h2D=" << h2D << " me=" << me;
if (h2D->GetNbinsX()==me->getNbinsX()){
for (int bin=1;bin!=h2D->GetNbinsX();bin++){
TH1D * tmp = h2D->ProjectionY(" ", bin, bin);
double rms = tmp->GetRMS();
tmp->Delete();
me->setBinContent(bin,rms);
}
} else {
throw cms::Exception("FitSlicesYTool") << "Different number of bins!";
}
}
7 changes: 0 additions & 7 deletions DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,9 @@ class CSCCorrelatedLCTDigi
/// LCT phi - gem pad phi for ME11
float getGEMDPhi() const {return gemDPhi;}

/// LCT phi - gem pad phi for ME11
float getGEMDPhiBits() const {return gemDPhiBits;}

/// set gem pad deltaPhi for ME11
void setGEMDPhi(const float dphi) {gemDPhi = dphi;}

/// set gem pad deltaPhi for ME11
void setGEMDPhiBits(const uint16_t dphi) {gemDPhiBits = dphi;}

private:
uint16_t trknmb;
uint16_t valid;
Expand All @@ -113,7 +107,6 @@ class CSCCorrelatedLCTDigi
uint16_t syncErr;
uint16_t cscID;
float gemDPhi;
uint16_t gemDPhiBits;
};

std::ostream & operator<<(std::ostream & o, const CSCCorrelatedLCTDigi& digi);
Expand Down
4 changes: 2 additions & 2 deletions DataFormats/CSCDigi/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
<class name="CSCComparatorDigi" ClassVersion="10">
<version ClassVersion="10" checksum="656608282"/>
</class>
<class name="CSCCorrelatedLCTDigi" ClassVersion="13">
<version ClassVersion="13" checksum="81142555"/>
<class name="CSCCorrelatedLCTDigi" ClassVersion="11">
<version ClassVersion="11" checksum="3605618748"/>
</class>
<class name="CSCCLCTDigi" ClassVersion="10">
<version ClassVersion="10" checksum="3910057547"/>
Expand Down
2 changes: 2 additions & 0 deletions DataFormats/HcalDetId/interface/HcalDetId.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class HcalDetId : public DetId {
int iphi() const;
/// get the tower depth
int depth() const;
/// reverse format
uint32_t otherForm() const;
/// get the smallest crystal_ieta of the crystal in front of this tower (HB and HE tower 17 only)
int crystal_ieta_low() const { return ((ieta()-zside())*5)+zside(); }
/// get the largest crystal_ieta of the crystal in front of this tower (HB and HE tower 17 only)
Expand Down
2 changes: 2 additions & 0 deletions DataFormats/HcalDetId/interface/HcalZDCDetId.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class HcalZDCDetId : public DetId {
int depth() const;
/// get the channel
int channel() const;
/// reverse format
uint32_t otherForm() const;

uint32_t denseIndex() const ;

Expand Down
38 changes: 26 additions & 12 deletions DataFormats/HcalDetId/src/HcalDetId.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ HcalDetId::HcalDetId(HcalSubdetector subdet, int tower_ieta, int tower_iphi, int
((tower_ieta>0)?(0x2000|((tower_ieta&0x3F)<<7)):(((-tower_ieta)&0x3F)<<7)) |
(tower_iphi&0x7F);
} else {
id_ |= (0x1000000) | ((depth&0xF)<<19) |
((tower_ieta>0)?(0x800000|((tower_ieta&0x1FF)<<10)):(((-tower_ieta)&0x1FF)<<10)) |
id_ |= (0x1000000) | ((depth&0xF)<<20) |
((tower_ieta>0)?(0x80000|((tower_ieta&0x1FF)<<10)):(((-tower_ieta)&0x1FF)<<10)) |
(tower_iphi&0x3FF);
}
}
Expand Down Expand Up @@ -60,10 +60,10 @@ bool HcalDetId::operator==(DetId gen) const {
phi = rawid&0x7F;
dep = (rawid>>14)&0x1F;
} else {
zsid = (rawid&0x800000)?(1):(-1);
zsid = (rawid&0x80000)?(1):(-1);
eta = (rawid>>10)&0x1FF;
phi = rawid&0x3FF;
dep = (rawid>>19)&0xF;
dep = (rawid>>20)&0xF;
}
bool result=(zsid==zside() && eta==ietaAbs() && phi==iphi() && dep==depth());
return result;
Expand All @@ -79,10 +79,10 @@ bool HcalDetId::operator!=(DetId gen) const {
phi = rawid&0x7F;
dep = (rawid>>14)&0x1F;
} else {
zsid = (rawid&0x800000)?(1):(-1);
zsid = (rawid&0x80000)?(1):(-1);
eta = (rawid>>10)&0x1FF;
phi = rawid&0x3FF;
dep = (rawid>>19)&0xF;
dep = (rawid>>20)&0xF;
}
bool result=(zsid!=zside() || eta!=ietaAbs() || phi!=iphi() || dep!=depth());
return result;
Expand All @@ -100,19 +100,19 @@ bool HcalDetId::operator<(DetId gen) const {
phi = rawid&0x7F;
dep = (rawid>>14)&0x1F;
} else {
zsid = (rawid&0x800000)?(1):(-1);
zsid = (rawid&0x80000)?(1):(-1);
eta = (rawid>>10)&0x1FF;
phi = rawid&0x3FF;
dep = (rawid>>19)&0xF;
dep = (rawid>>20)&0xF;
}
rawid = 0;
if ((id_&0x1000000) == 0) {
rawid |= ((dep&0x1F)<<14) |
((zsid>0)?(0x2000|((eta&0x3F)<<7)):((eta&0x3F)<<7)) |
(phi&0x7F);
} else {
rawid |= (0x1000000) | ((dep&0xF)<<19) |
((zsid>0)?(0x800000|((eta&0x1FF)<<10)):((eta&0x1FF)<<10)) |
rawid |= (0x1000000) | ((dep&0xF)<<20) |
((zsid>0)?(0x80000|((eta&0x1FF)<<10)):((eta&0x1FF)<<10)) |
(phi&0x3FF);
}
return (id_&0x1FFFFFF)<rawid;
Expand All @@ -121,7 +121,7 @@ bool HcalDetId::operator<(DetId gen) const {

int HcalDetId::zside() const {
if (oldFormat()) return (id_&0x2000)?(1):(-1);
else return (id_&0x800000)?(1):(-1);
else return (id_&0x80000)?(1):(-1);
}

int HcalDetId::ietaAbs() const {
Expand All @@ -136,7 +136,21 @@ int HcalDetId::iphi() const {

int HcalDetId::depth() const {
if (oldFormat()) return (id_>>14)&0x1F;
else return (id_>>19)&0xF;
else return (id_>>20)&0xF;
}

uint32_t HcalDetId::otherForm() const {
uint32_t rawId = (id_&0xFE000000);
if (oldFormat()) {
rawId |= (0x1000000) | ((depth()&0xF)<<20) |
((ieta()>0)?(0x80000|((ieta()&0x1FF)<<10)):(((-ieta())&0x1FF)<<10)) |
(iphi()&0x3FF);
} else {
rawId |= ((depth()&0x1F)<<14) |
((ieta()>0)?(0x2000|((ieta()&0x3F)<<7)):(((-ieta())&0x3F)<<7)) |
(iphi()&0x7F);
}
return rawId;
}

int HcalDetId::crystal_iphi_low() const {
Expand Down
14 changes: 14 additions & 0 deletions DataFormats/HcalDetId/src/HcalZDCDetId.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,20 @@ int HcalZDCDetId::channel() const {
else return id_&0xF;
}

uint32_t HcalZDCDetId::otherForm() const {
uint32_t rawId = (id_&0xFE000000);
if (id_&0x10000 == 0) {
rawId |= (section()&0x7)<<5;
if (zside() > 0) rawId |= 0x100;
rawId |= (channel()&0x1F) | 0x10000;
} else {
rawId |= (section()&0x3)<<4;
if (zside() > 0) rawId |= 0x40;
rawId |= channel()&0xF;
}
return rawId;
}

uint32_t HcalZDCDetId::denseIndex() const {
const int se ( section() ) ;
uint32_t indx = channel() - 1;
Expand Down
Loading

0 comments on commit e289b52

Please sign in to comment.