-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
port HGCalRecAlgos/Producers in from CMSSW_6_2_0_SLHC26_patch3
- Loading branch information
Showing
28 changed files
with
1,321 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<use name="clhep"/> | ||
<use name="DataFormats/HGCRecHit"/> | ||
<use name="root"/> | ||
<use name="rootminuit"/> | ||
<use name="FWCore/MessageLogger"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="FWCore/Framework"/> | ||
<use name="CondFormats/DataRecord"/> | ||
<export> | ||
<lib name="1"/> | ||
</export> |
32 changes: 32 additions & 0 deletions
32
RecoLocalCalo/HGCalRecAlgos/interface/HGCalRecHitAbsAlgo.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#ifndef RecoLocalCalo_HGCalRecAlgos_HGCalRecHitAbsAlgo_HH | ||
#define RecoLocalCalo_HGCalRecAlgos_HGCalRecHitAbsAlgo_HH | ||
|
||
/** \class HGCalRecHitAbsAlgo | ||
* Template algorithm to make rechits from uncalibrated rechits | ||
* | ||
* | ||
* | ||
* \author Valeri Andreev | ||
*/ | ||
|
||
#include <vector> | ||
#include "DataFormats/HGCRecHit/interface/HGCRecHit.h" | ||
#include "DataFormats/HGCRecHit/interface/HGCUncalibratedRecHit.h" | ||
|
||
class HGCalRecHitAbsAlgo | ||
{ | ||
public: | ||
|
||
/// Constructor | ||
//HGCalRecHitAbsAlgo() { }; | ||
|
||
/// Destructor | ||
virtual ~HGCalRecHitAbsAlgo() { }; | ||
|
||
/// make rechits from dataframes | ||
|
||
virtual void setADCToGeVConstant(const float& value) = 0; | ||
virtual HGCRecHit makeRecHit(const HGCUncalibratedRecHit& uncalibRH, const uint32_t &flags) const = 0; | ||
|
||
}; | ||
#endif |
65 changes: 65 additions & 0 deletions
65
RecoLocalCalo/HGCalRecAlgos/interface/HGCalRecHitSimpleAlgo.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#ifndef RecoLocalCalo_HGCalRecAlgos_HGCalRecHitSimpleAlgo_HH | ||
#define RecoLocalCalo_HGCalRecAlgos_HGCalRecHitSimpleAlgo_HH | ||
|
||
/** \class HGCalRecHitSimpleAlgo | ||
* Simple algoritm to make HGCAL rechits from HGCAL uncalibrated rechits | ||
* , following Ecal sceleton | ||
* | ||
* \author Valeri Andreev | ||
*/ | ||
|
||
#include "RecoLocalCalo/HGCalRecAlgos/interface/HGCalRecHitAbsAlgo.h" | ||
#include "DataFormats/HGCDigi/interface/HGCDataFrame.h" | ||
#include "TMath.h" | ||
#include <iostream> | ||
|
||
class HGCalRecHitSimpleAlgo : public HGCalRecHitAbsAlgo { | ||
public: | ||
// default ctor | ||
HGCalRecHitSimpleAlgo() { | ||
adcToGeVConstant_ = -1; | ||
adcToGeVConstantIsSet_ = false; | ||
} | ||
|
||
virtual void setADCToGeVConstant(const float& value) { | ||
adcToGeVConstant_ = value; | ||
adcToGeVConstantIsSet_ = true; | ||
} | ||
|
||
|
||
// destructor | ||
virtual ~HGCalRecHitSimpleAlgo() { }; | ||
|
||
/// Compute parameters | ||
virtual HGCRecHit makeRecHit(const HGCUncalibratedRecHit& uncalibRH, | ||
// const float& intercalibConstant, | ||
// const float& timeIntercalib = 0, | ||
const uint32_t& flags = 0) const { | ||
|
||
if(!adcToGeVConstantIsSet_) { | ||
std::cout << "HGCalRecHitSimpleAlgo::makeRecHit: adcToGeVConstant_ not set before calling this method!" << | ||
" will use -1 and produce bogus rechits!" << std::endl; | ||
} | ||
|
||
// float clockToNsConstant = 25; | ||
float energy = uncalibRH.amplitude() * adcToGeVConstant_; | ||
float time = uncalibRH.jitter(); | ||
if(time<0) time = 0; // fast-track digi conversion | ||
|
||
HGCRecHit rh( uncalibRH.id(), energy, time ); | ||
|
||
// Now fill flags | ||
|
||
bool good=true; | ||
|
||
|
||
if (good) rh.setFlag(HGCRecHit::kGood); | ||
return rh; | ||
} | ||
|
||
private: | ||
float adcToGeVConstant_; | ||
bool adcToGeVConstantIsSet_; | ||
|
||
}; | ||
#endif |
27 changes: 27 additions & 0 deletions
27
RecoLocalCalo/HGCalRecAlgos/interface/HGCalUncalibRecHitRecAbsAlgo.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#ifndef RecoLocalCalo_HGCalRecAlgos_HGCalUncalibRecHitRecAbsAlgo_HH | ||
#define RecoLocalCalo_HGCalRecAlgos_HGCalUncalibRecHitRecAbsAlgo_HH | ||
|
||
/** \class HGCalUncalibRecHitRecAbsAlgo | ||
* Template used by Ecal to compute amplitude, pedestal, time jitter, chi2 of a pulse | ||
* using a weights method | ||
* | ||
* \author | ||
*/ | ||
|
||
#include "Math/SVector.h" | ||
#include "Math/SMatrix.h" | ||
#include <vector> | ||
#include "DataFormats/HGCRecHit/interface/HGCUncalibratedRecHit.h" | ||
|
||
template<class C> class HGCalUncalibRecHitRecAbsAlgo | ||
{ | ||
public: | ||
enum { nWeightsRows = 3, iAmplitude = 0, iPedestal = 1, iTime = 2 }; // in the case of saturation | ||
|
||
/// Constructor | ||
|
||
virtual HGCUncalibratedRecHit makeRecHit(const C& dataFrame | ||
) = 0; | ||
|
||
}; | ||
#endif |
45 changes: 45 additions & 0 deletions
45
RecoLocalCalo/HGCalRecAlgos/interface/HGCalUncalibRecHitRecWeightsAlgo.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#ifndef RecoLocalCalo_HGCalRecAlgos_HGCalUncalibRecHitRecWeightsAlgo_HH | ||
#define RecoLocalCalo_HGCalRecAlgos_HGCalUncalibRecHitRecWeightsAlgo_HH | ||
|
||
/** \class HGalUncalibRecHitRecWeightsAlgo | ||
* compute amplitude, pedestal, time jitter, chi2 of a pulse | ||
* using a weights method, a la Ecal | ||
* | ||
* \author Valeri Andreev | ||
* | ||
* | ||
*/ | ||
|
||
#include "RecoLocalCalo/HGCalRecAlgos/interface/HGCalUncalibRecHitRecAbsAlgo.h" | ||
#include "Math/SVector.h" | ||
#include <vector> | ||
|
||
template<class C> class HGCalUncalibRecHitRecWeightsAlgo | ||
{ | ||
public: | ||
// destructor | ||
virtual ~HGCalUncalibRecHitRecWeightsAlgo<C>() { }; | ||
|
||
/// Compute parameters | ||
virtual HGCUncalibratedRecHit makeRecHit( | ||
const C& dataFrame | ||
) { | ||
double amplitude_(-1.), pedestal_(-1.), jitter_(-1.), chi2_(-1.); | ||
uint32_t flag = 0; | ||
double energy = 0; | ||
|
||
// static const int MAXSAMPLES = 10; | ||
// ROOT::Math::SVector<double,MAXSAMPLES> frame; | ||
|
||
for (int iSample = 0 ; iSample < dataFrame.size(); ++iSample) | ||
{ | ||
// frame(iSample) = double(dataFrame.sample(iSample).adc()); | ||
energy += double(dataFrame.sample(iSample).adc()); | ||
} | ||
|
||
amplitude_ = energy; // fast-track simhits propagation | ||
|
||
return HGCUncalibratedRecHit( dataFrame.id(), amplitude_, pedestal_, jitter_, chi2_, flag); | ||
} | ||
}; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<use name="FWCore/MessageLogger"/> | ||
<use name="FWCore/Framework"/> | ||
<use name="clhep"/> | ||
<export> | ||
<lib name="1"/> | ||
</export> |
22 changes: 22 additions & 0 deletions
22
RecoLocalCalo/HGCalRecProducers/interface/HGCalRecHitWorkerBaseClass.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef RecoLocalCalo_HGCalRecProducers_HGCalRecHitWorkerBaseClass_hh | ||
#define RecoLocalCalo_HGCalRecProducers_HGCalRecHitWorkerBaseClass_hh | ||
|
||
#include "DataFormats/HGCRecHit/interface/HGCRecHitCollections.h" | ||
|
||
namespace edm { | ||
class Event; | ||
class EventSetup; | ||
class ParameterSet; | ||
} | ||
|
||
class HGCalRecHitWorkerBaseClass { | ||
public: | ||
|
||
HGCalRecHitWorkerBaseClass(const edm::ParameterSet&) {}; | ||
virtual ~HGCalRecHitWorkerBaseClass() {}; | ||
|
||
virtual void set(const edm::EventSetup& es) = 0; | ||
virtual bool run(const edm::Event& evt, const HGCUncalibratedRecHit& uncalibRH, HGCRecHitCollection & result) = 0; | ||
}; | ||
|
||
#endif |
8 changes: 8 additions & 0 deletions
8
RecoLocalCalo/HGCalRecProducers/interface/HGCalRecHitWorkerFactory.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef RecoLocalCalo_HGCalRecProducers_HGCalRecHitWorkerFactory_hh | ||
#define RecoLocalCalo_HGCalRecProducers_HGCalRecHitWorkerFactory_hh | ||
|
||
#include "FWCore/PluginManager/interface/PluginFactory.h" | ||
#include "RecoLocalCalo/HGCalRecProducers/interface/HGCalRecHitWorkerBaseClass.h" | ||
typedef edmplugin::PluginFactory< HGCalRecHitWorkerBaseClass*(const edm::ParameterSet&) > HGCalRecHitWorkerFactory; | ||
|
||
#endif |
24 changes: 24 additions & 0 deletions
24
RecoLocalCalo/HGCalRecProducers/interface/HGCalUncalibRecHitWorkerBaseClass.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef RecoLocalCalo_HGCalRecProducers_HGCalUncalibRecHitWorkerBaseClass_hh | ||
#define RecoLocalCalo_HGCalRecProducers_HGCalUncalibRecHitWorkerBaseClass_hh | ||
|
||
#include "DataFormats/HGCRecHit/interface/HGCRecHitCollections.h" | ||
#include "DataFormats/HGCDigi/interface/HGCDigiCollections.h" | ||
|
||
namespace edm { | ||
class Event; | ||
class EventSetup; | ||
class ParameterSet; | ||
} | ||
|
||
class HGCalUncalibRecHitWorkerBaseClass { | ||
public: | ||
HGCalUncalibRecHitWorkerBaseClass(const edm::ParameterSet&){} | ||
virtual ~HGCalUncalibRecHitWorkerBaseClass(){} | ||
|
||
virtual void set(const edm::EventSetup& es) = 0; | ||
virtual bool run1(const edm::Event& evt, const HGCEEDigiCollection::const_iterator & digi, HGCeeUncalibratedRecHitCollection & result) = 0; | ||
virtual bool run2(const edm::Event& evt, const HGCHEDigiCollection::const_iterator & digi, HGChefUncalibratedRecHitCollection & result) = 0; | ||
virtual bool run3(const edm::Event& evt, const HGCHEDigiCollection::const_iterator & digi, HGChebUncalibratedRecHitCollection & result) = 0; | ||
}; | ||
|
||
#endif |
8 changes: 8 additions & 0 deletions
8
RecoLocalCalo/HGCalRecProducers/interface/HGCalUncalibRecHitWorkerFactory.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef RecoLocalCalo_HGCalRecProducers_HGCalUncalibRecHitWorkerFactory_hh | ||
#define RecoLocalCalo_HGCalRecProducers_HGCalUncalibRecHitWorkerFactory_hh | ||
|
||
#include "FWCore/PluginManager/interface/PluginFactory.h" | ||
#include "RecoLocalCalo/HGCalRecProducers/interface/HGCalUncalibRecHitWorkerBaseClass.h" | ||
typedef edmplugin::PluginFactory< HGCalUncalibRecHitWorkerBaseClass*(const edm::ParameterSet&) > HGCalUncalibRecHitWorkerFactory; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<use name="Geometry/CaloGeometry"/> | ||
<use name="RecoLocalCalo/HGCalRecProducers"/> | ||
<use name="RecoLocalCalo/HGCalRecAlgos"/> | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<use name="DataFormats/HGCDigi"/> | ||
<use name="DataFormats/HGCRecHit"/> | ||
<use name="CondFormats/DataRecord"/> | ||
<use name="FWCore/MessageLogger"/> | ||
<use name="FWCore/MessageService"/> | ||
<library file="*.cc" name="RecoLocalCaloHGCalRecProducersPlugins"> | ||
<flags EDM_PLUGIN="1"/> | ||
</library> |
Oops, something went wrong.