Skip to content

Commit

Permalink
Merge pull request #20 from cms-sw/CMSSW_6_2_X_SLHC
Browse files Browse the repository at this point in the history
Merge cms-sw CMSSW_6_2_X_SLHC into my CMSSW_6_2_X_SLHC
  • Loading branch information
venturia committed May 29, 2014
2 parents 59e1fd4 + 6abea4e commit f59bbbe
Show file tree
Hide file tree
Showing 430 changed files with 21,368 additions and 10,252 deletions.
1 change: 1 addition & 0 deletions CalibCalorimetry/EcalLaserCorrection/BuildFile.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<use name="Geometry/CaloGeometry"/>
<use name="CondFormats/DataRecord"/>
<use name="CondFormats/EcalObjects"/>
<use name="CalibCalorimetry/EcalLaserAnalyzer"/>
Expand Down
17 changes: 12 additions & 5 deletions CalibCalorimetry/EcalLaserCorrection/src/EcalLaserDbService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "CalibCalorimetry/EcalLaserAnalyzer/interface/MEEEGeom.h"
// #include "CalibCalorimetry/EcalLaserAnalyzer/interface/ME.h"

#include "Geometry/CaloGeometry/interface/CaloGenericDetId.h" // Shervin

#include "FWCore/MessageLogger/interface/MessageLogger.h"

Expand Down Expand Up @@ -65,7 +66,7 @@ float EcalLaserDbService::getLaserCorrection (DetId const & xid, edm::Timestamp
edm::LogError("EcalLaserDbService") << " DetId is NOT in ECAL" << endl;
return correctionFactor;
}

EEDetId eedetidForShashlik = CaloGenericDetId(DetId::Ecal, EcalEndcap, 1);
// int hi = -1;
// if (xid.subdetId()==EcalBarrel) {
// // std::cout << "EcalBarrel" << std::endl;
Expand All @@ -91,6 +92,10 @@ float EcalLaserDbService::getLaserCorrection (DetId const & xid, edm::Timestamp
MEEEGeom::SuperCrysCoord iX = (eeid.ix()-1)/5 + 1;
MEEEGeom::SuperCrysCoord iY = (eeid.iy()-1)/5 + 1;
iLM = MEEEGeom::lmr(iX, iY, eeid.zside());
} else if(xid.subdetId()==EcalShashlik){
MEEEGeom::SuperCrysCoord iX = (eedetidForShashlik.ix()-1)/5 + 1;
MEEEGeom::SuperCrysCoord iY = (eedetidForShashlik.iy()-1)/5 + 1;
iLM = MEEEGeom::lmr(iX, iY, eedetidForShashlik.zside());
} else {
edm::LogError("EcalLaserDbService") << " DetId is NOT in ECAL Barrel or Endcap" << endl;
return correctionFactor;
Expand All @@ -99,7 +104,8 @@ float EcalLaserDbService::getLaserCorrection (DetId const & xid, edm::Timestamp

// get alpha, apd/pn ref, apd/pn pairs and timestamps for interpolation

EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap::const_iterator itratio = laserRatiosMap.find(xid);
EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap::const_iterator itratio
= laserRatiosMap.find( (xid.subdetId()==EcalShashlik) ? eedetidForShashlik : xid); //Shervin
if (itratio != laserRatiosMap.end()) {
apdpnpair = (*itratio);
} else {
Expand All @@ -114,7 +120,8 @@ float EcalLaserDbService::getLaserCorrection (DetId const & xid, edm::Timestamp
return correctionFactor;
}

EcalLinearCorrections::EcalValueMap::const_iterator itlin = linearValueMap.find(xid);
EcalLinearCorrections::EcalValueMap::const_iterator itlin
= linearValueMap.find( (xid.subdetId()==EcalShashlik) ? eedetidForShashlik : xid); //Shervin
if (itlin != linearValueMap.end()) {
linValues = (*itlin);
} else {
Expand All @@ -129,15 +136,15 @@ float EcalLaserDbService::getLaserCorrection (DetId const & xid, edm::Timestamp
return correctionFactor;
}

EcalLaserAPDPNRatiosRefMap::const_iterator itref = laserRefMap.find(xid);
EcalLaserAPDPNRatiosRefMap::const_iterator itref = laserRefMap.find((xid.subdetId()==EcalShashlik) ? eedetidForShashlik : xid); //Shervin
if ( itref != laserRefMap.end() ) {
apdpnref = (*itref);
} else {
edm::LogError("EcalLaserDbService") << "error with laserRefMap!" << endl;
return correctionFactor;
}

EcalLaserAlphaMap::const_iterator italpha = laserAlphaMap.find(xid);
EcalLaserAlphaMap::const_iterator italpha = laserAlphaMap.find( (xid.subdetId()==EcalShashlik) ? eedetidForShashlik : xid); // Shervin
if ( italpha != laserAlphaMap.end() ) {
alpha = (*italpha);
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

EcalTrivialObjectAnalyzer = cms.EDAnalyzer("EcalTrivialObjectAnalyzer"
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Created: 2 Mar 2006
// Shahram Rahatlou, University of Rome & INFN
//
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "CalibCalorimetry/EcalTrivialCondModules/interface/EcalTrivialObjectAnalyzer.h"

#include <stdexcept>
Expand All @@ -14,6 +15,7 @@
#include "FWCore/Framework/interface/ESHandle.h"

#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "DataFormats/EcalDetId/interface/EKDetId.h"

#include "CondFormats/EcalObjects/interface/EcalPedestals.h"
#include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h"
Expand Down Expand Up @@ -91,22 +93,40 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet
edm::ESHandle<EcalADCToGeVConstant> pAgc;
context.get<EcalADCToGeVConstantRcd>().get(pAgc);
const EcalADCToGeVConstant* agc = pAgc.product();
std::cout << "Global ADC->GeV scale: EB " << std::setprecision(6) << agc->getEBValue() << " GeV/ADC count"
" EE " << std::setprecision(6) << agc->getEEValue() << " GeV/ADC count" << std::endl;

std::cout << "Global ADC->GeV scale:"
<< " EB " << std::setprecision(6) << agc->getEBValue() << " GeV/ADC count"
<< " EE " << std::setprecision(6) << agc->getEEValue() << " GeV/ADC count"
<< " EK " << std::setprecision(6) << agc->getEKValue() << " GeV/ADC count" << std::endl;
// use a channel to fetch values from DB
double r1 = (double)std::rand()/( double(RAND_MAX)+double(1) );
int ieta = int( 1 + r1*85 );
r1 = (double)std::rand()/( double(RAND_MAX)+double(1) );
int iphi = int( 1 + r1*20 );

EBDetId ebid(ieta,iphi); //eta,phi
std::cout << "EcalTrivialObjectAnalyzer: using EBDetId: " << ebid << std::endl;

//EEDetId eeid(10,10);
EKDetId ekid(EKDetId::detIdFromDenseIndex(0));
std::cout << "EcalTrivialObjectAnalyzer: using " << std::endl
<< "EBDetId: " << ebid
<< "EKDetId: " << ekid
<< std::endl;

const EcalPedestals* myped=pPeds.product();
EcalPedestals::const_iterator it = myped->find(ebid.rawId());
if( it!=myped->end() ){
std::cout << "EcalPedestal: "
std::cout << "EcalPedestal EB: "
<< " mean_x1: " << std::setprecision(8) << (*it).mean_x1 << " rms_x1: " << (*it).rms_x1
<< " mean_x6: " <<(*it).mean_x6 << " rms_x6: " << (*it).rms_x6
<< " mean_x12: " <<(*it).mean_x12 << " rms_x12: " << (*it).rms_x12
<< std::endl;
} else {
std::cout << "No pedestal found for this xtal! something wrong with EcalPedestals in your DB? "
<< std::endl;
}

it = myped->find(ekid.rawId());
if( it!=myped->end() ){
std::cout << "EcalPedestal EK: "
<< " mean_x1: " << std::setprecision(8) << (*it).mean_x1 << " rms_x1: " << (*it).rms_x1
<< " mean_x6: " <<(*it).mean_x6 << " rms_x6: " << (*it).rms_x6
<< " mean_x12: " <<(*it).mean_x12 << " rms_x12: " << (*it).rms_x12
Expand All @@ -116,6 +136,7 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet
<< std::endl;
}


// fetch map of groups of xtals
edm::ESHandle<EcalWeightXtalGroups> pGrp;
context.get<EcalWeightXtalGroupsRcd>().get(pGrp);
Expand All @@ -137,11 +158,21 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet
const EcalGainRatios* gr = pRatio.product();

EcalGainRatioMap::const_iterator grit=gr->getMap().find(ebid.rawId());
EcalMGPAGainRatio mgpa;
if( grit!=gr->getMap().end() ){
mgpa = (*grit);
EcalMGPAGainRatio mgpa = (*grit);
std::cout << "EcalMGPAGainRatio: EB"
<< "gain 12/6 : " << std::setprecision(4) << mgpa.gain12Over6() << " gain 6/1: " << mgpa.gain6Over1()
<< std::endl;
} else {
std::cout << "No MGPA Gain Ratio found for this xtal! something wrong with EcalGainRatios in your DB? "
<< std::endl;
}

grit=gr->getMap().find(ekid.rawId());
if( grit!=gr->getMap().end() ){
EcalMGPAGainRatio mgpa = (*grit);

std::cout << "EcalMGPAGainRatio: "
std::cout << "EcalMGPAGainRatio: EK"
<< "gain 12/6 : " << std::setprecision(4) << mgpa.gain12Over6() << " gain 6/1: " << mgpa.gain6Over1()
<< std::endl;
} else {
Expand All @@ -159,7 +190,7 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet
if( icalit!=ical->getMap().end() ){
icalconst = (*icalit);

std::cout << "EcalIntercalibConstant: "
std::cout << "EcalIntercalibConstant EB: "
<<std::setprecision(6)
<< icalconst
<< std::endl;
Expand All @@ -168,6 +199,27 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet
<< std::endl;
}

icalit=ical->getMap().find(ekid.rawId());
if( icalit!=ical->getMap().end() ){
EcalIntercalibConstant icalconst = (*icalit);

std::cout << "EcalIntercalibConstant EK: "
<<std::setprecision(6)
<< icalconst
<< std::endl;
} else {
std::cout << "No intercalib const found for this xtal! something wrong with EcalIntercalibConstants in your DB? "
<< std::endl;
}

EcalIntercalibConstants::Items items = ical->getMap().endcapItems();

for(EcalIntercalibConstants::Items::const_iterator itr = items.begin();
itr!=items.end();
itr++){
if(fabs(*itr-1.)<0.0001)
std::cout << "[EcalTrivialObjectAnalyzer DUMP] " << "EE hashedIndex: " << itr-items.begin() << "\tIC: " << *itr << std::endl;
}
// Intercalib errors
edm::ESHandle<EcalIntercalibErrors> pIcalErr;
context.get<EcalIntercalibErrorsRcd>().get(pIcalErr);
Expand All @@ -188,11 +240,14 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet
}



{ // quick and dirty for cut and paste ;) it is a test program...
{
edm::ESHandle<EcalTimeCalibConstants> pIcal;
context.get<EcalTimeCalibConstantsRcd>().get(pIcal);
if(!pIcal.isValid()){
edm::LogWarning("EcalTrivialObjectAnalyzer") << "EcalTimeCalibConstantsRcd not found";
} else
{ // quick and dirty for cut and paste ;) it is a test program...
// TimeCalib constants
edm::ESHandle<EcalTimeCalibConstants> pIcal;
context.get<EcalTimeCalibConstantsRcd>().get(pIcal);
const EcalTimeCalibConstants* ical = pIcal.product();

EcalTimeCalibConstantMap::const_iterator icalit=ical->getMap().find(ebid.rawId());
Expand Down Expand Up @@ -228,7 +283,7 @@ void EcalTrivialObjectAnalyzer::analyze(const edm::Event& e, const edm::EventSet
<< std::endl;
}
}

}
// fetch Time Offset
//std::cout <<"Fetching TimeOffsetConstant from DB " << std::endl;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import FWCore.ParameterSet.Config as cms

import FWCore.ParameterSet.Config as cms

process = cms.Process('testTrivial')

# import of standard configurations
process.load('Configuration.StandardSequences.Services_cff')
process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
process.load('FWCore.MessageService.MessageLogger_cfi')
process.load('Configuration.EventContent.EventContent_cff')
process.load('SimGeneral.MixingModule.mixNoPU_cfi')
process.load('Configuration.Geometry.GeometryExtended2023SHCalNoTaperReco_cff')
process.load('Configuration.StandardSequences.MagneticField_38T_PostLS1_cff')
process.load('Configuration.StandardSequences.Digi_cff')
process.load('Configuration.StandardSequences.SimL1Emulator_cff')
process.load('Configuration.StandardSequences.DigiToRaw_cff')
process.load('Configuration.StandardSequences.EndOfProcess_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')

process.load("CalibCalorimetry.EcalTrivialCondModules.EcalTrivialObjectAnalyzer_cfi")

process.testTrivial = cms.Sequence(process.EcalTrivialObjectAnalyzer)

process.maxEvents = cms.untracked.PSet(
input = cms.untracked.int32(1)
)

# Input source
process.source = cms.Source("PoolSource",
secondaryFileNames = cms.untracked.vstring(),
fileNames = cms.untracked.vstring('file:step3.root')
)

from Configuration.AlCa.GlobalTag import GlobalTag
process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:upgradePLS3', '')


process.p = cms.Path( process.testTrivial )
2 changes: 1 addition & 1 deletion CondFormats/ESObjects/interface/ESCondObjectContainer.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef ES_COND_OBJECT_CONTAINER_HH
#define ES_COND_OBJECT_CONTAINER_HH

#include "DataFormats/EcalDetId/interface/EcalContainer.h"
#include "CondFormats/EcalObjects/interface/EcalContainer.h"
#include "DataFormats/EcalDetId/interface/ESDetId.h"

template < typename T >
Expand Down
6 changes: 5 additions & 1 deletion CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@
class EcalADCToGeVConstant {
public:
EcalADCToGeVConstant();
//EcalADCToGeVConstant(const float & EBvalue, const float & EEvalue, const float & EKvalue);
EcalADCToGeVConstant(const float & EBvalue, const float & EEvalue);
~EcalADCToGeVConstant();
void setEBValue(const float& value) { EBvalue_ = value; }
void setEEValue(const float& value) { EEvalue_ = value; }
//void setEKValue(const float& value) { EKvalue_ = value; }
float getEBValue() const { return EBvalue_; }
float getEEValue() const { return EEvalue_; }
float getEKValue() const { return EEvalue_; } // Shervin fix to EKvalue_
void print(std::ostream& s) const {
s << "EcalADCToGeVConstant: EB " << EBvalue_ << "; EE " << EEvalue_ << " [GeV/ADC count]";
s << "EcalADCToGeVConstant: EB " << EBvalue_ << "; EE " << EEvalue_; // << "; EK " << EKvalue_ << " [GeV/ADC count]";
}
private:
float EBvalue_;
float EEvalue_;
//float EKvalue_;
};

/**
Expand Down
Loading

0 comments on commit f59bbbe

Please sign in to comment.