CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
reco::BeamHaloSummaryProducer Class Reference

#include <BeamHaloSummaryProducer.h>

Inheritance diagram for reco::BeamHaloSummaryProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 BeamHaloSummaryProducer (const edm::ParameterSet &)
 
 ~BeamHaloSummaryProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

virtual void beginJob ()
 
virtual void beginRun (edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
virtual void endRun (edm::Run &, const edm::EventSetup &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 

Private Attributes

edm::InputTag IT_CSCHaloData
 
edm::InputTag IT_EcalHaloData
 
edm::InputTag IT_GlobalHaloData
 
edm::InputTag IT_HcalHaloData
 
float L_EcalPhiWedgeConfidence
 
int L_EcalPhiWedgeConstituents
 
float L_EcalPhiWedgeEnergy
 
float L_EcalPhiWedgeToF
 
float L_EcalShowerShapesAngle
 
float L_EcalShowerShapesRoundness
 
float L_EcalSuperClusterEnergy
 
int L_EcalSuperClusterSize
 
float L_HcalPhiWedgeConfidence
 
int L_HcalPhiWedgeConstituents
 
float L_HcalPhiWedgeEnergy
 
float L_HcalPhiWedgeToF
 
float T_EcalPhiWedgeConfidence
 
int T_EcalPhiWedgeConstituents
 
float T_EcalPhiWedgeEnergy
 
float T_EcalPhiWedgeToF
 
float T_EcalShowerShapesAngle
 
float T_EcalShowerShapesRoundness
 
float T_EcalSuperClusterEnergy
 
int T_EcalSuperClusterSize
 
float T_HcalPhiWedgeConfidence
 
int T_HcalPhiWedgeConstituents
 
float T_HcalPhiWedgeEnergy
 
float T_HcalPhiWedgeToF
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 58 of file BeamHaloSummaryProducer.h.

Constructor & Destructor Documentation

BeamHaloSummaryProducer::BeamHaloSummaryProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 14 of file BeamHaloSummaryProducer.cc.

References edm::ParameterSet::getParameter().

15 {
16  IT_CSCHaloData = iConfig.getParameter<edm::InputTag>("CSCHaloDataLabel");
17  IT_EcalHaloData = iConfig.getParameter<edm::InputTag>("EcalHaloDataLabel");
18  IT_HcalHaloData = iConfig.getParameter<edm::InputTag>("HcalHaloDataLabel");
19  IT_GlobalHaloData = iConfig.getParameter<edm::InputTag>("GlobalHaloDataLabel");
20 
21  L_EcalPhiWedgeEnergy = (float) iConfig.getParameter<double>("l_EcalPhiWedgeEnergy");
22  L_EcalPhiWedgeConstituents = iConfig.getParameter<int>("l_EcalPhiWedgeConstituents");
23  L_EcalPhiWedgeToF = (float)iConfig.getParameter<double>("l_EcalPhiWedgeToF");
24  L_EcalPhiWedgeConfidence = (float)iConfig.getParameter<double>("l_EcalPhiWedgeConfidence");
25  L_EcalShowerShapesRoundness = (float)iConfig.getParameter<double>("l_EcalShowerShapesRoundness");
26  L_EcalShowerShapesAngle =(float) iConfig.getParameter<double>("l_EcalShowerShapesAngle");
27  L_EcalSuperClusterSize = (int) iConfig.getParameter<int>("l_EcalSuperClusterSize");
28  L_EcalSuperClusterEnergy = (float) iConfig.getParameter<double>("l_EcalSuperClusterEnergy");
29 
30  T_EcalPhiWedgeEnergy = (float)iConfig.getParameter<double>("t_EcalPhiWedgeEnergy");
31  T_EcalPhiWedgeConstituents = iConfig.getParameter<int>("t_EcalPhiWedgeConstituents");
32  T_EcalPhiWedgeToF = (float)iConfig.getParameter<double>("t_EcalPhiWedgeToF");
33  T_EcalPhiWedgeConfidence = (float)iConfig.getParameter<double>("t_EcalPhiWedgeConfidence");
34  T_EcalShowerShapesRoundness = (float)iConfig.getParameter<double>("t_EcalShowerShapesRoundness");
35  T_EcalShowerShapesAngle = (float)iConfig.getParameter<double>("t_EcalShowerShapesAngle");
36  T_EcalSuperClusterSize = (int) iConfig.getParameter<int>("t_EcalSuperClusterSize");
37  T_EcalSuperClusterEnergy = (float) iConfig.getParameter<double>("t_EcalSuperClusterEnergy");
38 
39  L_HcalPhiWedgeEnergy = (float)iConfig.getParameter<double>("l_HcalPhiWedgeEnergy");
40  L_HcalPhiWedgeConstituents = iConfig.getParameter<int>("l_HcalPhiWedgeConstituents");
41  L_HcalPhiWedgeToF = (float)iConfig.getParameter<double>("l_HcalPhiWedgeToF");
42  L_HcalPhiWedgeConfidence = (float)iConfig.getParameter<double>("l_HcalPhiWedgeConfidence");
43 
44  T_HcalPhiWedgeEnergy = (float)iConfig.getParameter<double>("t_HcalPhiWedgeEnergy");
45  T_HcalPhiWedgeConstituents = iConfig.getParameter<int>("t_HcalPhiWedgeConstituents");
46  T_HcalPhiWedgeToF = (float)iConfig.getParameter<double>("t_HcalPhiWedgeToF");
47  T_HcalPhiWedgeConfidence = (float)iConfig.getParameter<double>("t_HcalPhiWedgeConfidence");
48 
49  produces<BeamHaloSummary>();
50 }
T getParameter(std::string const &) const
BeamHaloSummaryProducer::~BeamHaloSummaryProducer ( )

Definition at line 229 of file BeamHaloSummaryProducer.cc.

229 {}

Member Function Documentation

void BeamHaloSummaryProducer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 225 of file BeamHaloSummaryProducer.cc.

225 {return;}
void BeamHaloSummaryProducer::beginRun ( edm::Run ,
const edm::EventSetup  
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 227 of file BeamHaloSummaryProducer.cc.

227 {return;}
void BeamHaloSummaryProducer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 226 of file BeamHaloSummaryProducer.cc.

226 {return;}
void BeamHaloSummaryProducer::endRun ( edm::Run ,
const edm::EventSetup  
)
privatevirtual

Reimplemented from edm::EDProducer.

Definition at line 228 of file BeamHaloSummaryProducer.cc.

228 {return;}
void BeamHaloSummaryProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDProducer.

Definition at line 52 of file BeamHaloSummaryProducer.cc.

References abs, angle(), BeamHaloSummary_cfi::BeamHaloSummary, edm::Event::getByLabel(), reco::GlobalHaloData::GetMatchedEcalPhiWedges(), reco::GlobalHaloData::GetMatchedHcalPhiWedges(), reco::HcalHaloData::GetPhiWedges(), reco::EcalHaloData::GetShowerShapesAngle(), reco::EcalHaloData::GetShowerShapesRoundness(), reco::EcalHaloData::GetSuperClusters(), i, n, reco::CSCHaloData::NumberOfHaloTracks(), reco::CSCHaloData::NumberOfHaloTriggers(), reco::CSCHaloData::NumberOfOutOfTimeTriggers(), edm::Handle< T >::product(), edm::Event::put(), and edm::RefVector< C, T, F >::size().

53 {
54  // BeamHaloSummary object
55  std::auto_ptr<BeamHaloSummary> TheBeamHaloSummary( new BeamHaloSummary() );
56 
57  // CSC Specific Halo Data
58  Handle<CSCHaloData> TheCSCHaloData;
59  iEvent.getByLabel(IT_CSCHaloData, TheCSCHaloData);
60 
61  const CSCHaloData CSCData = (*TheCSCHaloData.product() );
62  //Loose Id (any one of the three criteria)
63  if( CSCData.NumberOfHaloTriggers() || CSCData.NumberOfHaloTracks() || CSCData.NumberOfOutOfTimeTriggers() )
64  TheBeamHaloSummary->GetCSCHaloReport()[0] = 1;
65 
66  //Tight Id (any two of the previous three criteria)
67  if( (CSCData.NumberOfHaloTriggers() && CSCData.NumberOfHaloTracks()) ||
68  (CSCData.NumberOfHaloTriggers() && CSCData.NumberOfOutOfTimeTriggers()) ||
69  (CSCData.NumberOfHaloTracks() && CSCData.NumberOfOutOfTimeTriggers() ) )
70  TheBeamHaloSummary->GetCSCHaloReport()[1] = 1;
71 
72  //Ecal Specific Halo Data
73  Handle<EcalHaloData> TheEcalHaloData;
74  iEvent.getByLabel(IT_EcalHaloData, TheEcalHaloData);
75 
76  const EcalHaloData EcalData = (*TheEcalHaloData.product() );
77 
78  bool EcalLooseId = false, EcalTightId = false;
79  /* COMMENTED OUT, NEEDS TO BE TUNED
80  const std::vector<PhiWedge> EcalWedges = EcalData.GetPhiWedges();
81  for( std::vector<PhiWedge>::const_iterator iWedge = EcalWedges.begin() ; iWedge != EcalWedges.end() ; iWedge++ )
82  {
83  bool EcaliPhi = false;
84 
85  //Loose Id
86  if(iWedge-> Energy() > L_EcalPhiWedgeEnergy && iWedge->NumberOfConstituents() > L_EcalPhiWedgeConstituents && std::abs(iWedge->ZDirectionConfidence()) > L_EcalPhiWedgeConfidence)
87  {
88  EcalLooseId = true;
89  EcaliPhi = true;
90  }
91 
92  //Tight Id
93  if( iWedge-> Energy() > T_EcalPhiWedgeEnergy && iWedge->NumberOfConstituents() > T_EcalPhiWedgeConstituents && iWedge->ZDirectionConfidence() > L_EcalPhiWedgeConfidence )
94  {
95  EcalTightId = true;
96  EcaliPhi = true;
97  }
98 
99  for( unsigned int i = 0 ; i < TheBeamHaloSummary->GetEcaliPhiSuspects().size() ; i++ )
100  {
101  if( iWedge->iPhi() == TheBeamHaloSummary->GetEcaliPhiSuspects()[i] )
102  {
103  EcaliPhi = false; // already stored this iPhi
104  continue;
105  }
106  }
107 
108  if( EcaliPhi )
109  TheBeamHaloSummary->GetEcaliPhiSuspects().push_back( iWedge->iPhi() ) ;
110  }
111  */
112 
113  edm::ValueMap<float> vm_Angle = EcalData.GetShowerShapesAngle();
114  edm::ValueMap<float> vm_Roundness = EcalData.GetShowerShapesRoundness();
115 
116  //Access selected SuperClusters
117  for(unsigned int n = 0 ; n < EcalData.GetSuperClusters().size() ; n++ )
118  {
120 
121  float angle = vm_Angle[cluster];
122  float roundness = vm_Roundness[cluster];
123 
124  //Loose Selection
125  if( (angle > 0. && angle < L_EcalShowerShapesAngle ) && ( roundness > 0. && roundness < L_EcalShowerShapesRoundness ) )
126  {
127  if( cluster->energy() > L_EcalSuperClusterEnergy && cluster->size() > (unsigned int) L_EcalSuperClusterSize )
128  EcalLooseId = true;
129  }
130 
131  //Tight Selection
132  if( (angle > 0. && angle < T_EcalShowerShapesAngle ) && ( roundness > 0. && roundness < T_EcalShowerShapesRoundness ) )
133  {
134  if( cluster->energy() > T_EcalSuperClusterEnergy && cluster->size() > (unsigned int)T_EcalSuperClusterSize )
135  EcalTightId = true;
136  }
137  }
138 
139  if( EcalLooseId )
140  TheBeamHaloSummary->GetEcalHaloReport()[0] = 1;
141  if( EcalTightId )
142  TheBeamHaloSummary->GetEcalHaloReport()[1] = 1;
143 
144 
145 
146  // Hcal Specific Halo Data
147  Handle<HcalHaloData> TheHcalHaloData;
148  iEvent.getByLabel(IT_HcalHaloData, TheHcalHaloData);
149  const HcalHaloData HcalData = (*TheHcalHaloData.product() );
150  const std::vector<PhiWedge> HcalWedges = HcalData.GetPhiWedges();
151  bool HcalLooseId = false, HcalTightId = false;
152  for( std::vector<PhiWedge>::const_iterator iWedge = HcalWedges.begin() ; iWedge != HcalWedges.end() ; iWedge++ )
153  {
154  bool HcaliPhi = false;
155  //Loose Id
156  if( iWedge-> Energy() > L_HcalPhiWedgeEnergy && iWedge->NumberOfConstituents() > L_HcalPhiWedgeConstituents && std::abs(iWedge->ZDirectionConfidence()) > L_HcalPhiWedgeConfidence)
157  {
158  HcalLooseId = true;
159  HcaliPhi = true;
160  }
161 
162  //Tight Id
163  if( iWedge-> Energy() > T_HcalPhiWedgeEnergy && iWedge->NumberOfConstituents() > T_HcalPhiWedgeConstituents && std::abs(iWedge->ZDirectionConfidence()) > T_HcalPhiWedgeConfidence)
164  {
165  HcalTightId = true;
166  HcaliPhi = true;
167  }
168 
169  for( unsigned int i = 0 ; i < TheBeamHaloSummary->GetHcaliPhiSuspects().size() ; i++ )
170  {
171  if( iWedge->iPhi() == TheBeamHaloSummary->GetHcaliPhiSuspects()[i] )
172  {
173  HcaliPhi = false; // already stored this iPhi
174  continue;
175  }
176  }
177  if( HcaliPhi )
178  TheBeamHaloSummary->GetHcaliPhiSuspects().push_back( iWedge->iPhi() ) ;
179  }
180 
181  if( HcalLooseId )
182  TheBeamHaloSummary->GetHcalHaloReport()[0] = 1;
183  if( HcalTightId )
184  TheBeamHaloSummary->GetHcalHaloReport()[1] = 1;
185 
186  // Global Halo Data
187  Handle<GlobalHaloData> TheGlobalHaloData;
188  iEvent.getByLabel(IT_GlobalHaloData, TheGlobalHaloData);
189  bool GlobalLooseId = false;
190  bool GlobalTightId = false;
191  const GlobalHaloData GlobalData = (*TheGlobalHaloData.product() );
192  const std::vector<PhiWedge> MatchedHcalWedges = GlobalData.GetMatchedHcalPhiWedges();
193  const std::vector<PhiWedge> MatchedEcalWedges = GlobalData.GetMatchedEcalPhiWedges();
194 
195  //Loose Id
196  if( MatchedEcalWedges.size() || MatchedHcalWedges.size() )
197  GlobalLooseId = true;
198 
199  //Tight Id
200  for( std::vector<PhiWedge>::const_iterator iWedge = MatchedEcalWedges.begin() ; iWedge != MatchedEcalWedges.end(); iWedge ++ )
201  {
202  if( iWedge->NumberOfConstituents() > T_EcalPhiWedgeConstituents )
203  GlobalTightId = true;
204  if( std::abs(iWedge->ZDirectionConfidence() > T_EcalPhiWedgeConfidence) )
205  GlobalTightId = true;
206  }
207 
208  for( std::vector<PhiWedge>::const_iterator iWedge = MatchedHcalWedges.begin() ; iWedge != MatchedHcalWedges.end(); iWedge ++ )
209  {
210  if( iWedge->NumberOfConstituents() > T_HcalPhiWedgeConstituents )
211  GlobalTightId = true;
212  if( std::abs(iWedge->ZDirectionConfidence()) > T_HcalPhiWedgeConfidence )
213  GlobalTightId = true;
214  }
215 
216  if( GlobalLooseId )
217  TheBeamHaloSummary->GetGlobalHaloReport()[0] = 1;
218  if( GlobalTightId )
219  TheBeamHaloSummary->GetGlobalHaloReport()[1] = 1;
220 
221  iEvent.put(TheBeamHaloSummary);
222  return;
223 }
int i
Definition: DBlmapReader.cc:9
int NumberOfHaloTracks(HaloData::Endcap z=HaloData::both) const
Definition: CSCHaloData.cc:83
edm::ValueMap< float > & GetShowerShapesRoundness()
Definition: EcalHaloData.h:41
edm::RefVector< reco::SuperClusterCollection > & GetSuperClusters()
Definition: EcalHaloData.h:36
edm::ValueMap< float > & GetShowerShapesAngle()
Definition: EcalHaloData.h:44
#define abs(x)
Definition: mlp_lapack.h:159
short int NumberOfOutOfTimeTriggers(HaloData::Endcap z=HaloData::both) const
Definition: CSCHaloData.cc:73
std::vector< PhiWedge > & GetMatchedEcalPhiWedges()
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:84
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
int NumberOfHaloTriggers(HaloData::Endcap z=HaloData::both) const
Definition: CSCHaloData.cc:63
T const * product() const
Definition: Handle.h:74
std::vector< PhiWedge > & GetMatchedHcalPhiWedges()
size_type size() const
Size of the RefVector.
Definition: RefVector.h:85
const std::vector< PhiWedge > & GetPhiWedges() const
Definition: HcalHaloData.h:21
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

Member Data Documentation

edm::InputTag reco::BeamHaloSummaryProducer::IT_CSCHaloData
private

Definition at line 72 of file BeamHaloSummaryProducer.h.

edm::InputTag reco::BeamHaloSummaryProducer::IT_EcalHaloData
private

Definition at line 73 of file BeamHaloSummaryProducer.h.

edm::InputTag reco::BeamHaloSummaryProducer::IT_GlobalHaloData
private

Definition at line 75 of file BeamHaloSummaryProducer.h.

edm::InputTag reco::BeamHaloSummaryProducer::IT_HcalHaloData
private

Definition at line 74 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::L_EcalPhiWedgeConfidence
private

Definition at line 80 of file BeamHaloSummaryProducer.h.

int reco::BeamHaloSummaryProducer::L_EcalPhiWedgeConstituents
private

Definition at line 78 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::L_EcalPhiWedgeEnergy
private

Definition at line 77 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::L_EcalPhiWedgeToF
private

Definition at line 79 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::L_EcalShowerShapesAngle
private

Definition at line 82 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::L_EcalShowerShapesRoundness
private

Definition at line 81 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::L_EcalSuperClusterEnergy
private

Definition at line 84 of file BeamHaloSummaryProducer.h.

int reco::BeamHaloSummaryProducer::L_EcalSuperClusterSize
private

Definition at line 83 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::L_HcalPhiWedgeConfidence
private

Definition at line 98 of file BeamHaloSummaryProducer.h.

int reco::BeamHaloSummaryProducer::L_HcalPhiWedgeConstituents
private

Definition at line 96 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::L_HcalPhiWedgeEnergy
private

Definition at line 95 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::L_HcalPhiWedgeToF
private

Definition at line 97 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::T_EcalPhiWedgeConfidence
private

Definition at line 89 of file BeamHaloSummaryProducer.h.

int reco::BeamHaloSummaryProducer::T_EcalPhiWedgeConstituents
private

Definition at line 87 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::T_EcalPhiWedgeEnergy
private

Definition at line 86 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::T_EcalPhiWedgeToF
private

Definition at line 88 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::T_EcalShowerShapesAngle
private

Definition at line 91 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::T_EcalShowerShapesRoundness
private

Definition at line 90 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::T_EcalSuperClusterEnergy
private

Definition at line 93 of file BeamHaloSummaryProducer.h.

int reco::BeamHaloSummaryProducer::T_EcalSuperClusterSize
private

Definition at line 92 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::T_HcalPhiWedgeConfidence
private

Definition at line 103 of file BeamHaloSummaryProducer.h.

int reco::BeamHaloSummaryProducer::T_HcalPhiWedgeConstituents
private

Definition at line 101 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::T_HcalPhiWedgeEnergy
private

Definition at line 100 of file BeamHaloSummaryProducer.h.

float reco::BeamHaloSummaryProducer::T_HcalPhiWedgeToF
private

Definition at line 102 of file BeamHaloSummaryProducer.h.