Skip to content

Commit

Permalink
Merge pull request cms-sw#9 from gem-sw/CMSSW_6_2_X_SLHC
Browse files Browse the repository at this point in the history
update
  • Loading branch information
Cesare committed Jan 20, 2014
2 parents 02b6580 + a8ee610 commit 950a4a5
Show file tree
Hide file tree
Showing 450 changed files with 54,625 additions and 6,723 deletions.
13 changes: 12 additions & 1 deletion CalibFormats/HcalObjects/interface/HcalCalibrationWidthsSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "CalibFormats/HcalObjects/interface/HcalCalibrationWidths.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
#include <vector>

/** \class HcalCalibrationWidthsSet
Expand All @@ -20,7 +21,17 @@ class HcalCalibrationWidthsSet {
void clear();
private:
struct CalibWidthSetObject {
CalibWidthSetObject(const DetId& aid) : id(aid) { }
CalibWidthSetObject(const DetId& aid) {
if (aid.det()==DetId::Hcal) {
HcalDetId hcid(aid);
id = HcalDetId(hcid.subdet(),hcid.ieta(),hcid.iphi(),hcid.depth());
} else if (aid.det()==DetId::Calo && aid.subdetId()==HcalZDCDetId::SubdetectorId) {
HcalZDCDetId hcid(aid);
id = HcalZDCDetId(hcid.section(),(hcid.zside()>0),hcid.channel());
} else {
id = aid;
}
}
DetId id;
HcalCalibrationWidths calib;
bool operator<(const CalibWidthSetObject& cso) const { return id < cso.id; }
Expand Down
13 changes: 12 additions & 1 deletion CalibFormats/HcalObjects/interface/HcalCalibrationsSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "CalibFormats/HcalObjects/interface/HcalCalibrations.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
#include <vector>

/** \class HcalCalibrationsSet
Expand All @@ -20,7 +21,17 @@ class HcalCalibrationsSet {
void clear();
private:
struct CalibSetObject {
CalibSetObject(const DetId& aid) : id(aid) { }
CalibSetObject(const DetId& aid) {
if (aid.det()==DetId::Hcal) {
HcalDetId hcid(aid);
id = HcalDetId(hcid.subdet(),hcid.ieta(),hcid.iphi(),hcid.depth());
} else if (aid.det()==DetId::Calo && aid.subdetId()==HcalZDCDetId::SubdetectorId) {
HcalZDCDetId hcid(aid);
id = HcalZDCDetId(hcid.section(),(hcid.zside()>0),hcid.channel());
} else {
id = aid;
}
}
DetId id;
HcalCalibrations calib;
bool operator<(const CalibSetObject& cso) const { return id < cso.id; }
Expand Down
14 changes: 10 additions & 4 deletions CalibFormats/HcalObjects/src/HcalCalibrationWidthsSet.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "CalibFormats/HcalObjects/interface/HcalCalibrationWidthsSet.h"
#include "DataFormats/HcalDetId/interface/HcalGenericDetId.h"
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "DataFormats/HcalDetId/interface/HcalZDCDetId.h"
#include "FWCore/Utilities/interface/Exception.h"
#include <algorithm>
#include <iostream>
Expand All @@ -17,18 +19,22 @@ const HcalCalibrationWidths& HcalCalibrationWidthsSet::getCalibrationWidths(cons
else {
cell = std::find(mItems.begin(),mItems.end(), target);
}
if (cell == mItems.end() || cell->id != fId)
if (cell == mItems.end() ||
((fId.det()==DetId::Hcal && HcalDetId(cell->id) != HcalDetId(fId)) ||
(fId.det()==DetId::Calo && fId.subdetId()==HcalZDCDetId::SubdetectorId && HcalZDCDetId(cell->id) != HcalZDCDetId(fId)) ||
(fId.det()!=DetId::Hcal && (fId.det()==DetId::Calo && fId.subdetId()!=HcalZDCDetId::SubdetectorId) && (cell->id != fId))))
throw cms::Exception ("Conditions not found") << "Unavailable HcalCalibrationWidths for cell " << HcalGenericDetId(fId);
return cell->calib;
}

void HcalCalibrationWidthsSet::setCalibrationWidths(DetId fId, const HcalCalibrationWidths& ca) {
Item target(fId);
sorted_=false;
std::vector<Item>::iterator cell=std::find(mItems.begin(),mItems.end(),Item(fId)); //slow, but guaranteed
std::vector<Item>::iterator cell=std::find(mItems.begin(),mItems.end(),target); //slow, but guaranteed
if (cell==mItems.end())
{
mItems.push_back(Item(fId));
mItems.at(mItems.size()-1).calib=ca;
target.calib=ca;
mItems.push_back(target);
return;
}
cell->calib=ca;
Expand Down
5 changes: 4 additions & 1 deletion CalibFormats/HcalObjects/src/HcalCalibrationsSet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const HcalCalibrations& HcalCalibrationsSet::getCalibrations(const DetId fId) co
else {
cell = std::find(mItems.begin(),mItems.end(), target);
}
if (cell == mItems.end() || cell->id != fId)
if (cell == mItems.end() ||
((fId.det()==DetId::Hcal && HcalDetId(cell->id) != HcalDetId(fId)) ||
(fId.det()==DetId::Calo && fId.subdetId()==HcalZDCDetId::SubdetectorId && HcalZDCDetId(cell->id) != HcalZDCDetId(fId)) ||
(fId.det()!=DetId::Hcal && (fId.det()==DetId::Calo && fId.subdetId()!=HcalZDCDetId::SubdetectorId) && (cell->id != fId))))
throw cms::Exception ("Conditions not found") << "Unavailable HcalCalibrations for cell " << HcalGenericDetId(fId);
return cell->calib;
}
Expand Down
11 changes: 7 additions & 4 deletions CondFormats/HcalObjects/interface/HcalCondObjectContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define HcalCondObjectContainer_h

#include <vector>
#include <iostream>
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
#include "DataFormats/HcalDetId/interface/HcalOtherDetId.h"
#include "DataFormats/HcalDetId/interface/HcalCastorDetId.h"
Expand Down Expand Up @@ -123,7 +124,6 @@ template<class Item> const Item*
HcalCondObjectContainer<Item>::getValues(DetId fId, bool throwOnFail) const
{
unsigned int index=indexFor(fId);

const Item* cell = NULL;

if (index<0xFFFFFFFu) {
Expand All @@ -147,15 +147,16 @@ HcalCondObjectContainer<Item>::getValues(DetId fId, bool throwOnFail) const
}
}
}

// Item emptyItem;
// if (cell->rawId() == emptyItem.rawId() )
if ((!cell)) {
if (throwOnFail) {
throw cms::Exception ("Conditions not found")
<< "Unavailable Conditions of type " << myname() << " for cell " << textForId(fId);
}
} else if (cell->rawId() != fId) {
} else if ((fId.det()==DetId::Hcal && HcalDetId(cell->rawId()) != HcalDetId(fId)) ||
(fId.det()==DetId::Calo && fId.subdetId()==HcalZDCDetId::SubdetectorId && HcalZDCDetId(cell->rawId()) != HcalZDCDetId(fId)) ||
(fId.det()!=DetId::Hcal && (fId.det()==DetId::Calo && fId.subdetId()!=HcalZDCDetId::SubdetectorId) && (cell->rawId() != fId))) {
if (throwOnFail) {
throw cms::Exception ("Conditions mismatch")
<< "Requested conditions of type " << myname() << " for cell " << textForId(fId) << " got conditions for cell " << textForId(DetId(cell->rawId()));
Expand All @@ -172,7 +173,9 @@ HcalCondObjectContainer<Item>::exists(DetId fId) const
const Item* cell = getValues(fId,false);

if (cell)
if (cell->rawId() == fId )
if ((fId.det()==DetId::Hcal && HcalDetId(cell->rawId()) == HcalDetId(fId)) ||
(fId.det()==DetId::Calo && fId.subdetId()==HcalZDCDetId::SubdetectorId && HcalZDCDetId(cell->rawId()) == HcalZDCDetId(fId)) ||
(fId.det()!=DetId::Hcal && (fId.det()==DetId::Calo && fId.subdetId()!=HcalZDCDetId::SubdetectorId) && (cell->rawId() == fId)))
return true;

return false;
Expand Down
12 changes: 8 additions & 4 deletions CondFormats/HcalObjects/src/HcalCholeskyMatrices.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ HcalCholeskyMatrices::getValues(DetId fId, bool throwOnFail) const

// HcalCholeskyMatrix emptyHcalCholeskyMatrix;
// if (cell->rawId() == emptyHcalCholeskyMatrix.rawId() )
if ((!cell) || (cell->rawId() != fId ) ) {
if ((!cell) ||
(fId.det()==DetId::Hcal && HcalDetId(cell->rawId()) != HcalDetId(fId)) ||
(fId.det()==DetId::Calo && fId.subdetId()==HcalZDCDetId::SubdetectorId && HcalZDCDetId(cell->rawId()) != HcalZDCDetId(fId)) ||
(fId.det()!=DetId::Hcal && (fId.det()==DetId::Calo && fId.subdetId()!=HcalZDCDetId::SubdetectorId) && (cell->rawId() != fId))) {
if (throwOnFail) {
throw cms::Exception ("Conditions not found")
throw cms::Exception ("Conditions not found")
<< "Unavailable Conditions of type " << myname() << " for cell " << fId.rawId();
} else {
cell=0;
Expand All @@ -63,8 +66,9 @@ HcalCholeskyMatrices::exists(DetId fId) const

// HcalCholeskyMatrix emptyHcalCholeskyMatrix;
if (cell)
// if (cell->rawId() != emptyHcalCholeskyMatrix.rawId() )
if (cell->rawId() == fId )
if ((fId.det()==DetId::Hcal && HcalDetId(cell->rawId()) == HcalDetId(fId)) ||
(fId.det()==DetId::Calo && fId.subdetId()==HcalZDCDetId::SubdetectorId && HcalZDCDetId(cell->rawId()) == HcalZDCDetId(fId)) ||
(fId.det()!=DetId::Hcal && (fId.det()==DetId::Calo && fId.subdetId()!=HcalZDCDetId::SubdetectorId) && (cell->rawId() == fId)))
return true;

return false;
Expand Down
14 changes: 9 additions & 5 deletions CondFormats/HcalObjects/src/HcalCovarianceMatrices.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ HcalCovarianceMatrices::initContainer(DetId fId)
case(HcalForward) : for (unsigned int i=0; i<sizeFor(fId); i++) HFcontainer.push_back(emptyItem); break;
default: break;
}
}
}

}

Expand All @@ -50,9 +50,12 @@ HcalCovarianceMatrices::getValues(DetId fId, bool throwOnFail) const

// HcalCovarianceMatrix emptyHcalCovarianceMatrix;
// if (cell->rawId() == emptyHcalCovarianceMatrix.rawId() )
if ((!cell) || (cell->rawId() != fId ) ) {
if ((!cell) ||
(fId.det()==DetId::Hcal && HcalDetId(cell->rawId()) != HcalDetId(fId)) ||
(fId.det()==DetId::Calo && fId.subdetId()==HcalZDCDetId::SubdetectorId && HcalZDCDetId(cell->rawId()) != HcalZDCDetId(fId)) ||
(fId.det()!=DetId::Hcal && (fId.det()==DetId::Calo && fId.subdetId()!=HcalZDCDetId::SubdetectorId) && (cell->rawId() != fId))) {
if (throwOnFail) {
throw cms::Exception ("Conditions not found")
throw cms::Exception ("Conditions not found")
<< "Unavailable Conditions of type " << myname() << " for cell " << fId.rawId();
} else {
cell=0;
Expand All @@ -68,8 +71,9 @@ HcalCovarianceMatrices::exists(DetId fId) const

// HcalCovarianceMatrix emptyHcalCovarianceMatrix;
if (cell)
// if (cell->rawId() != emptyHcalCovarianceMatrix.rawId() )
if (cell->rawId() == fId )
if ((fId.det()==DetId::Hcal && HcalDetId(cell->rawId()) == HcalDetId(fId)) ||
(fId.det()==DetId::Calo && fId.subdetId()==HcalZDCDetId::SubdetectorId && HcalZDCDetId(cell->rawId()) == HcalZDCDetId(fId)) ||
(fId.det()!=DetId::Hcal && (fId.det()==DetId::Calo && fId.subdetId()!=HcalZDCDetId::SubdetectorId) && (cell->rawId() == fId)))
return true;

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

# Ideal geometry, needed for transient ECAL alignement
from Configuration.Geometry.GeometryExtended2023HGCalMuon_cff import *

# Reconstruction geometry services
# Tracking Geometry
#bah - well, this is not a cfi!
from Geometry.CommonDetUnit.globalTrackingSLHCGeometry_cfi import *

#Tracker
from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *
from Geometry.TrackerNumberingBuilder.trackerTopologyConstants_cfi import *

#Muon
from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *
from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *
from Geometry.GEMGeometry.gemGeometry_cfi import *
from Geometry.GEMGeometry.me0Geometry_cfi import *

# Alignment
from Geometry.TrackerGeometryBuilder.idealForDigiTrackerSLHCGeometry_cff import *
from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *
from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *
trackerSLHCGeometry.applyAlignment = cms.bool(False)

# Calorimeters
from Geometry.CaloEventSetup.CaloTopology_cfi import *
from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import *

CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder",
SelectedCalos = cms.vstring('HCAL' ,
'ZDC' ,
'CASTOR' ,
'EcalBarrel' ,
'TOWER' )
)

from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import *
from Geometry.HcalEventSetup.HcalGeometry_cfi import *
from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import *
from Geometry.HcalEventSetup.HcalTopology_cfi import *
from Geometry.ForwardGeometry.ForwardGeometry_cfi import *

from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import *
from Geometry.EcalMapping.EcalMapping_cfi import *
from Geometry.EcalMapping.EcalMappingRecord_cfi import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

from Geometry.CMSCommonData.cmsExtendedGeometry2023HGCalMuonXML_cfi import *
from Geometry.TrackerNumberingBuilder.trackerNumberingSLHCGeometry_cfi import *
47 changes: 47 additions & 0 deletions Configuration/Geometry/python/GeometryExtended2023HGCalReco_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import FWCore.ParameterSet.Config as cms

# Ideal geometry, needed for transient ECAL alignement
from Configuration.Geometry.GeometryExtended2023HGCal_cff import *

# Reconstruction geometry services
# Tracking Geometry
#bah - well, this is not a cfi!
from Geometry.CommonDetUnit.globalTrackingSLHCGeometry_cfi import *

#Tracker
from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *
from Geometry.TrackerNumberingBuilder.trackerTopologyConstants_cfi import *

#Muon
from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *
from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *
from Geometry.GEMGeometry.gemGeometry_cfi import *
from Geometry.GEMGeometry.me0Geometry_cfi import *

# Alignment
from Geometry.TrackerGeometryBuilder.idealForDigiTrackerSLHCGeometry_cff import *
from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *
from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *
trackerSLHCGeometry.applyAlignment = cms.bool(False)

# Calorimeters
from Geometry.CaloEventSetup.CaloTopology_cfi import *
from Geometry.CaloEventSetup.CaloGeometryBuilder_cfi import *

CaloGeometryBuilder = cms.ESProducer("CaloGeometryBuilder",
SelectedCalos = cms.vstring('HCAL' ,
'ZDC' ,
'CASTOR' ,
'EcalBarrel' ,
'TOWER' )
)

from Geometry.EcalAlgo.EcalBarrelGeometry_cfi import *
from Geometry.HcalEventSetup.HcalGeometry_cfi import *
from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import *
from Geometry.HcalEventSetup.HcalTopology_cfi import *
from Geometry.ForwardGeometry.ForwardGeometry_cfi import *

from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import *
from Geometry.EcalMapping.EcalMapping_cfi import *
from Geometry.EcalMapping.EcalMappingRecord_cfi import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FWCore.ParameterSet.Config as cms

from Geometry.CMSCommonData.cmsExtendedGeometry2023HGCalXML_cfi import *
from Geometry.TrackerNumberingBuilder.trackerNumberingSLHCGeometry_cfi import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import FWCore.ParameterSet.Config as cms

# Ideal geometry, needed for transient ECAL alignement
from Configuration.Geometry.GeometryExtended2023RPCUpscope_cff import *



# Reconstruction geometry services
# Tracking Geometry
#bah - well, this is not a cfi!
from Geometry.CommonDetUnit.globalTrackingSLHCGeometry_cfi import *

#Tracker
from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *
from Geometry.TrackerNumberingBuilder.trackerTopologyConstants_cfi import *

#Muon
from Geometry.MuonNumbering.muonNumberingInitialization_cfi import *
from RecoMuon.DetLayers.muonDetLayerGeometry_cfi import *

# Alignment
from Geometry.TrackerGeometryBuilder.idealForDigiTrackerSLHCGeometry_cff import *
from Geometry.CSCGeometryBuilder.idealForDigiCscGeometry_cff import *
from Geometry.DTGeometryBuilder.idealForDigiDtGeometry_cff import *
trackerSLHCGeometry.applyAlignment = cms.bool(False)

# Calorimeters
from Geometry.CaloEventSetup.CaloTopology_cfi import *
from Geometry.CaloEventSetup.CaloGeometry_cff import *
from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import *
from Geometry.EcalMapping.EcalMapping_cfi import *
from Geometry.EcalMapping.EcalMappingRecord_cfi import *

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

#
# Geometry master configuration
#
# Ideal geometry, needed for simulation
from Geometry.CMSCommonData.cmsExtendedGeometry2023RPCUpscopeXML_cfi import *
from Geometry.TrackerNumberingBuilder.trackerNumberingSLHCGeometry_cfi import *
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import FWCore.ParameterSet.Config as cms

# Ideal geometry, needed for transient ECAL alignement
from Geometry.CMSCommonData.cmsExtendedGeometry2023HGCalXML_cfi import *
from Configuration.Geometry.GeometryExtended2023_cff import *

# Reconstruction geometry services
# Tracking Geometry
Expand Down Expand Up @@ -40,7 +40,6 @@
from Geometry.HcalEventSetup.CaloTowerGeometry_cfi import *
from Geometry.HcalEventSetup.HcalTopology_cfi import *
from Geometry.ForwardGeometry.ForwardGeometry_cfi import *

from Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi import *
from Geometry.EcalMapping.EcalMapping_cfi import *
from Geometry.EcalMapping.EcalMappingRecord_cfi import *
Expand Down
Loading

0 comments on commit 950a4a5

Please sign in to comment.