Skip to content

Commit

Permalink
Merge pull request #4 from gem-sw/CMSSW_6_2_X_SLHC
Browse files Browse the repository at this point in the history
Merge
  • Loading branch information
Sven Dildick committed Nov 26, 2013
2 parents ee3ce1c + 749c477 commit d00a104
Show file tree
Hide file tree
Showing 351 changed files with 38,973 additions and 4,635 deletions.
4 changes: 0 additions & 4 deletions Alignment/OfflineValidation/plugins/PrimaryVertexValidation.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
#include "DataFormats/TrackReco/interface/TrackFwd.h"
#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/SiStripDetId/interface/TIBDetId.h"
#include "DataFormats/SiStripDetId/interface/TIDDetId.h"
#include "DataFormats/SiStripDetId/interface/TOBDetId.h"
#include "DataFormats/SiStripDetId/interface/TECDetId.h"
#include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
#include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
Expand Down
149 changes: 140 additions & 9 deletions CalibCalorimetry/HcalAlgos/src/HcalPulseShapes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -286,19 +286,145 @@ void HcalPulseShapes::computeHFShape() {

void HcalPulseShapes::computeSiPMShape()
{
unsigned int nbin = 100; // to avoid big drop of integral for previous 512
// due to negative afterpulse (May 6, 2013. S.Abdullin)

unsigned int nbin = 128;

//From Jake Anderson: numberical convolution of SiPMs WLC shapes
std::vector<float> nt = {
2.782980485851731e-6,
4.518134885954626e-5,
2.7689305197392056e-4,
9.18328418900969e-4,
.002110072599166349,
.003867856860331454,
.006120046224897771,
.008754774090536956,
0.0116469503358586,
.01467007449455966,
.01770489955229477,
.02064621450689512,
.02340678093764222,
.02591874610854916,
.02813325527435303,
0.0300189241965647,
.03155968107671164,
.03275234052577155,
.03360415306318798,
.03413048377960748,
.03435270899678218,
.03429637464659661,
.03398962975487166,
.03346192884394954,
.03274298516247742,
.03186195009136525,
.03084679116113031,
0.0297238406141036,
.02851748748929785,
.02724998816332392,
.02594137274487424,
.02460942736731527,
.02326973510736116,
.02193576080366117,
0.0206189674254987,
.01932895378564653,
0.0180736052958666,
.01685925112650875,
0.0156908225633535,
.01457200857138456,
.01350540559602467,
.01249265947824805,
.01153459805300423,
.01063135355597282,
.009782474412011936,
.008987026319784546,
0.00824368281357106,
.007550805679909604,
.006906515742762193,
.006308754629755056,
.005755338185695127,
.005244002229973356,
.004772441359900532,
.004338341490928299,
.003939406800854143,
0.00357338171220501,
0.0032380685079891,
.002931341133259233,
.002651155690306086,
.002395558090237333,
.002162689279320922,
.001950788415487319,
.001758194329648101,
.001583345567913682,
.001424779275191974,
.001281129147671334,
0.00115112265163774,
.001033577678808199,
9.273987838127585e-4,
8.315731274976846e-4,
7.451662302008696e-4,
6.673176219006913e-4,
5.972364609644049e-4,
5.341971801529036e-4,
4.775352065178378e-4,
4.266427928961177e-4,
3.8096498904225923e-4,
3.3999577417327287e-4,
3.032743659102713e-4,
2.703817158798329e-4,
2.4093719775272793e-4,
2.145954900503894e-4,
1.9104365317752797e-4,
1.6999839784346724e-4,
1.5120354022478893e-4,
1.3442763782650755e-4,
1.1946179895521507e-4,
1.0611765796993575e-4,
9.422550797617687e-5,
8.363258233342666e-5,
7.420147621931836e-5,
6.580869950304933e-5,
5.834335229919868e-5,
5.17059147771959e-5,
4.5807143072062634e-5,
4.0567063461299446e-5,
3.591405732740723e-5,
3.178402980354131e-5,
2.811965539165646e-5,
2.4869694240316126e-5,
2.1988373166730962e-5,
1.9434825899529382e-5,
1.717258740121378e-5,
1.5169137499243157e-5,
1.339548941011129e-5,
1.1825819079078403e-5,
1.0437131581057595e-5,
9.208961130078894e-6,
8.12310153137994e-6,
7.163364176588591e-6,
6.315360932244386e-6,
5.566309502463164e-6,
4.904859063429651e-6,
4.320934164082596e-6,
3.8055950719111903e-6,
3.350912911083174e-6,
2.9498580949517117e-6,
2.596200697612328e-6,
2.2844215378879293e-6,
2.0096328693141094e-6,
1.7675076766686654e-6,
1.5542166787225756e-6,
1.366372225473431e-6,
1.200978365778838e-6,
1.0553864128982371e-6,
9.272554464808518e-7,
8.145171945902259e-7,
7.153448381918271e-7
};

siPMShape_.setNBin(nbin);
std::vector<float> nt(nbin,0.0); //

double norm = 0.;
for (unsigned int j = 0; j < nbin; ++j) {
if (j <= 31.)
nt[j] = 2.15*j;
else if ((j > 31) && (j <= 96))
nt[j] = 102.1 - 1.12*j;
else
nt[j] = 0.0076*j - 6.4;
norm += (nt[j]>0) ? nt[j] : 0.;
}

Expand All @@ -308,6 +434,11 @@ void HcalPulseShapes::computeSiPMShape()
}
}

// double HcalPulseShapes::gexp(double t, double A, double c, double t0, double s) {
// static double const root2(sqrt(2));
// return -A*0.5*exp(c*t+0.5*c*c*s*s-c*s)*(erf(-0.5*root2/s*(t-t0+c*s*s))-1);
// }


const HcalPulseShapes::Shape &
HcalPulseShapes::getShape(int shapeType) const
Expand Down
14 changes: 7 additions & 7 deletions CalibFormats/CaloObjects/src/CaloSamples.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,20 @@ CaloSamples::setBlank() // keep id, presamples, size but zero out data
}

std::ostream& operator<<(std::ostream& s, const CaloSamples& samples) {
s << "DetId=" << samples.id();
s << "DetId " << samples.id();
// print out every so many precise samples
float preciseStep = samples.preciseSize()/samples.size();
s << ", "<< samples.size() << " samples";
if (preciseStep > 0)
s << ", " << samples.preciseSize() << " preciseSamples"
<< ", " << preciseStep << " precise step";
<< ", " << preciseStep << " preciseStep";
s << '\n';
for (int i=0; i<samples.size(); i++) {
s << i << ":" << samples[i];
int precisei = i*preciseStep;
if(precisei < samples.preciseSize()) {
s << " " << samples.preciseAt(precisei) ;
}
s << i << ":" << samples[i] << " precise:";
int precise_start(i*preciseStep), precise_end(precise_start + preciseStep);
for (int j(precise_start); ((j<precise_end) && (j< samples.preciseSize()));
++j)
s << " " << samples.preciseAt(j);
s << std::endl;
}
return s;
Expand Down
2 changes: 2 additions & 0 deletions CondCore/GeometryPlugins/plugins/plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "Geometry/Records/interface/CSCRecoGeometryRcd.h"
#include "Geometry/Records/interface/DTRecoGeometryRcd.h"
#include "Geometry/Records/interface/RPCRecoGeometryRcd.h"
#include "Geometry/Records/interface/GEMRecoGeometryRcd.h"

#include "CondFormats/GeometryObjects/interface/PGeometricDetExtra.h"
#include "Geometry/Records/interface/PGeometricDetExtraRcd.h"
Expand All @@ -40,3 +41,4 @@ REGISTER_PLUGIN(CSCRecoDigiParametersRcd,CSCRecoDigiParameters);
REGISTER_PLUGIN(CSCRecoGeometryRcd,RecoIdealGeometry);
REGISTER_PLUGIN(DTRecoGeometryRcd,RecoIdealGeometry);
REGISTER_PLUGIN(RPCRecoGeometryRcd,RecoIdealGeometry);
REGISTER_PLUGIN(GEMRecoGeometryRcd,RecoIdealGeometry);
2 changes: 2 additions & 0 deletions CondTools/Geometry/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<use name="Geometry/DTGeometryBuilder"/>
<use name="Geometry/RPCGeometry"/>
<use name="Geometry/RPCGeometryBuilder"/>
<use name="Geometry/GEMGeometry"/>
<use name="Geometry/GEMGeometryBuilder"/>
<use name="Geometry/MuonNumbering"/>
<use name="CondFormats/Alignment"/>
<library file="*.cc" name="CondToolsGeometryPlugins">
Expand Down
75 changes: 75 additions & 0 deletions CondTools/Geometry/plugins/GEMRecoIdealDBLoader.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "CondFormats/GeometryObjects/interface/RecoIdealGeometry.h"
#include "DetectorDescription/Core/interface/DDCompactView.h"
#include "Geometry/GEMGeometryBuilder/src/GEMGeometryParsFromDD.h"
#include "Geometry/MuonNumbering/interface/MuonDDDConstants.h"
#include "Geometry/Records/interface/GEMRecoGeometryRcd.h"
#include "Geometry/Records/interface/MuonNumberingRecord.h"

#include <iostream>

using namespace std;

class GEMRecoIdealDBLoader : public edm::EDAnalyzer
{
public:

explicit GEMRecoIdealDBLoader( const edm::ParameterSet& );
~GEMRecoIdealDBLoader( void );

virtual void beginRun( const edm::Run&, edm::EventSetup const& );
virtual void analyze( const edm::Event&, const edm::EventSetup& ) {}
virtual void endJob( void ) {};
};

GEMRecoIdealDBLoader::GEMRecoIdealDBLoader( const edm::ParameterSet& )
{
std::cout << "GEMRecoIdealDBLoader::GEMRecoIdealDBLoader" << std::endl;
}

GEMRecoIdealDBLoader::~GEMRecoIdealDBLoader()
{
std::cout << "GEMRecoIdealDBLoader::~GEMRecoIdealDBLoader" << std::endl;
}

void
GEMRecoIdealDBLoader::beginRun( const edm::Run&, edm::EventSetup const& es )
{
edm::Service<cond::service::PoolDBOutputService> mydbservice;
if( !mydbservice.isAvailable())
{
edm::LogError( "GEMRecoIdealDBLoader" ) << "PoolDBOutputService unavailable";
return;
}

if( mydbservice->isNewTagRequest( "GEMRecoGeometryRcd" ))
{
edm::ESTransientHandle<DDCompactView> pDD;
edm::ESHandle<MuonDDDConstants> pMNDC;
es.get<IdealGeometryRecord>().get( pDD );
es.get<MuonNumberingRecord>().get( pMNDC );

const DDCompactView& cpv = *pDD;
GEMGeometryParsFromDD rpcpd;

RecoIdealGeometry* rig = new RecoIdealGeometry;
rpcpd.build( &cpv, *pMNDC, *rig );

mydbservice->createNewIOV<RecoIdealGeometry>( rig,
mydbservice->beginOfTime(),
mydbservice->endOfTime(),
"GEMRecoGeometryRcd" );
}
else
{
edm::LogError( "GEMRecoIdealDBLoader" ) << "GEMRecoGeometryRcd Tag is already present";
}
}

DEFINE_FWK_MODULE( GEMRecoIdealDBLoader );
10 changes: 0 additions & 10 deletions CondTools/Geometry/plugins/PGeometricDetBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"

#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h"

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

#include <iostream>
Expand Down Expand Up @@ -55,52 +53,44 @@ PGeometricDetBuilder::beginRun( const edm::Run&, edm::EventSetup const& es)
std::vector<const GeometricDet*>::const_iterator egit = tc.end();
int count=0;
int lev = 1;
// CmsTrackerStringToEnum ctste;
for (; git!= egit; ++git) { // one level below "tracker"
putOne(*git, pgd, lev);
std::vector<const GeometricDet*> inone = (*git)->components();
// << ctste.name((*git)->type())
// std::cout << lev << " type " << (*git)->type() << " " << int((*git)->geographicalId()) << std::endl; // << " has " << inone.size() << " components." << std::endl;
if ( inone.size() == 0 ) ++count;
std::vector<const GeometricDet*>::const_iterator git2 = inone.begin();
std::vector<const GeometricDet*>::const_iterator egit2 = inone.end();
++lev;
for (; git2 != egit2; ++git2) { // level 2
putOne(*git2, pgd, lev);
std::vector<const GeometricDet*> intwo= (*git2)->components();
// std::cout << lev << "\ttype " << (*git2)->type() << " " << int((*git2)->geographicalId()) << std::endl; // << " has " << intwo.size() << " components." << std::endl;
if ( intwo.size() == 0 ) ++count;
std::vector<const GeometricDet*>::const_iterator git3 = intwo.begin();
std::vector<const GeometricDet*>::const_iterator egit3 = intwo.end();
++lev;
for (; git3 != egit3; ++git3) { // level 3
putOne(*git3, pgd, lev);
std::vector<const GeometricDet*> inthree= (*git3)->components();
// std::cout << lev << "\t\ttype " << (*git3)->type() << " " << int((*git3)->geographicalId()) << std::endl; // << " has " << inthree.size() << " components." << std::endl;
if ( inthree.size() == 0 ) ++count;
std::vector<const GeometricDet*>::const_iterator git4 = inthree.begin();
std::vector<const GeometricDet*>::const_iterator egit4 = inthree.end();
++lev;
for (; git4 != egit4; ++git4) { //level 4
putOne(*git4, pgd, lev);
std::vector<const GeometricDet*> infour= (*git4)->components();
// std::cout << lev << "\t\t\ttype " << (*git4)->type() << " " << int((*git4)->geographicalId()) << std::endl; // << " has " << infour.size() << " components." << std::endl;
if ( infour.size() == 0 ) ++count;
std::vector<const GeometricDet*>::const_iterator git5 = infour.begin();
std::vector<const GeometricDet*>::const_iterator egit5 = infour.end();
++lev;
for (; git5 != egit5; ++git5) { // level 5
putOne(*git5, pgd, lev);
std::vector<const GeometricDet*> infive= (*git5)->components();
// std::cout << lev << "\t\t\t\ttype " << (*git5)->type() << " " << int((*git5)->geographicalId()) << std::endl; // << " has " << infive.size() << " components." << std::endl;
if ( infive.size() == 0 ) ++count;
std::vector<const GeometricDet*>::const_iterator git6 = infive.begin();
std::vector<const GeometricDet*>::const_iterator egit6 = infive.end();
++lev;
for (; git6 != egit6; ++git6) { //level 6
putOne(*git6, pgd, lev);
std::vector<const GeometricDet*> insix= (*git6)->components();
// std::cout << lev << "\t\t\t\t\ttype " << (*git6)->type() << " " << int((*git6)->geographicalId()) << std::endl; // << " has " << insix.size() << " components." << std::endl;
if ( insix.size() == 0 ) ++count;
} // level 6
--lev;
Expand Down
2 changes: 0 additions & 2 deletions CondTools/Geometry/plugins/PGeometricDetExtraBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"

#include "Geometry/TrackerNumberingBuilder/interface/CmsTrackerStringToEnum.h"

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

#include <iostream>
Expand Down
Loading

0 comments on commit d00a104

Please sign in to comment.