CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SimG4HcalHitJetFinder Class Reference

#include <SimG4HcalHitJetFinder.h>

Public Member Functions

std::vector< SimG4HcalHitCluster > * getClusters (bool)
 
double rDist (const double, const double, const double, const double) const
 
double rDist (const SimG4HcalHitCluster *, const CaloHit *) const
 
void setCone (double)
 
void setInput (std::vector< CaloHit > *)
 
 SimG4HcalHitJetFinder (double cone=0.5)
 
virtual ~SimG4HcalHitJetFinder ()
 

Private Attributes

std::vector< SimG4HcalHitClusterclusvector
 
std::vector< CaloHitinput
 
double jetcone
 

Detailed Description

Definition at line 13 of file SimG4HcalHitJetFinder.h.

Constructor & Destructor Documentation

◆ SimG4HcalHitJetFinder()

SimG4HcalHitJetFinder::SimG4HcalHitJetFinder ( double  cone = 0.5)

Definition at line 13 of file SimG4HcalHitJetFinder.cc.

13 : jetcone(cone) {}

◆ ~SimG4HcalHitJetFinder()

SimG4HcalHitJetFinder::~SimG4HcalHitJetFinder ( )
virtual

Definition at line 15 of file SimG4HcalHitJetFinder.cc.

15 { edm::LogInfo("ValidHcal") << "SimG4HcalHitJetFinder:: Deleting"; }

Member Function Documentation

◆ getClusters()

std::vector< SimG4HcalHitCluster > * SimG4HcalHitJetFinder::getClusters ( bool  hcal_only)

Definition at line 21 of file SimG4HcalHitJetFinder.cc.

21  {
22  clusvector.erase(clusvector.begin(), clusvector.end());
23  if (input.empty()) {
24  return &clusvector;
25  }
26 
27  std::vector<CaloHit>::iterator itr;
28  for (itr = input.begin(); itr != input.end(); itr++) {
29  edm::LogVerbatim("ValidHcal") << "HcalHitJetFinder::getClusters_1 - input : e " << itr->e() << " eta "
30  << itr->eta() << " phi " << itr->phi() << " subdet " << itr->det();
31  }
32 
33  sort(input.begin(), input.end()); // sort input in descending order
34 
35  for (itr = input.begin(); itr != input.end(); itr++) {
36  edm::LogVerbatim("ValidHcal") << "HcalHitJetFinder::getClusters_2 - input : e " << itr->e() << " eta "
37  << itr->eta() << " phi " << itr->phi() << " subdet " << itr->det();
38  }
39 
40  std::vector<SimG4HcalHitCluster> temp; // dummy container for clusters
41 
42  // first input hit -> first cluster
43 
44  CaloHit hit;
45  SimG4HcalHitCluster cluster;
46 
47  std::vector<CaloHit>::iterator itr_hits;
48 
49  int j, first_seed = 0;
50  for (j = 0, itr_hits = input.begin(); itr_hits != input.end(); j++, itr_hits++) {
51  int h_type = itr_hits->det(); // if desired HCAL hits (only) clusterfinding
52  if (((h_type == static_cast<int>(HcalBarrel) || h_type == static_cast<int>(HcalEndcap) ||
53  h_type == static_cast<int>(HcalForward)) &&
54  hcal_only) ||
55  (!hcal_only)) {
56  cluster += input[j];
57  edm::LogVerbatim("ValidHcal") << "HcalHitJetFinder:: First seed hit ..................\n" << (*itr_hits);
58  first_seed = j;
59  break;
60  }
61  }
62 
63  temp.push_back(cluster);
64 
65  std::vector<SimG4HcalHitCluster>::iterator itr_clus;
66 
67  for (j = 0, itr_hits = input.begin(); itr_hits != input.end(); j++, itr_hits++) {
68  int h_type = itr_hits->det(); // if desired HCAL hits (only) clusterfinding
69  if ((((h_type == static_cast<int>(HcalBarrel) || h_type == static_cast<int>(HcalEndcap) ||
70  h_type == static_cast<int>(HcalForward)) &&
71  hcal_only) ||
72  (!hcal_only)) &&
73  (j != first_seed)) {
74  edm::LogVerbatim("ValidHcal") << "HcalHitJetFinder:: ........... Consider hit ..................\n"
75  << (*itr_hits);
76 
77  int incl = 0; // if the hit is included in one of clusters
78 
79  int iclus;
80  for (itr_clus = temp.begin(), iclus = 0; itr_clus != temp.end(); itr_clus++, iclus++) {
81  edm::LogVerbatim("ValidHcal") << "HcalHitJetFinder::=======> Cluster " << iclus << "\n" << (*itr_clus);
82 
83  double d = rDist(&(*itr_clus), &(*itr_hits));
84  if (d < jetcone) {
85  edm::LogVerbatim("ValidHcal") << "HcalHitJetFinder:: -> associated ... ";
86  temp[iclus] += *itr_hits;
87  incl = 1;
88  break;
89  }
90  }
91 
92  // to here jumps "break"
93  if (incl == 0) {
95  cl += *itr_hits;
96  temp.push_back(cl);
97  edm::LogVerbatim("ValidHcal") << "HcalHitJetFinder:: ************ NEW CLUSTER !\n" << cl;
98  }
99  }
100  }
101 
102  clusvector = temp;
103  return &clusvector;
104 }

References GetRecoTauVFromDQM_MC_cff::cl, clusvector, ztail::d, HcalBarrel, HcalEndcap, HcalForward, input, dqmiolumiharvest::j, jetcone, rDist(), jetUpdater_cfi::sort, and groupFilesInBlocks::temp.

Referenced by SimG4HcalValidation::jetAnalysis().

◆ rDist() [1/2]

double SimG4HcalHitJetFinder::rDist ( const double  etac,
const double  phic,
const double  etah,
const double  phih 
) const

Definition at line 116 of file SimG4HcalHitJetFinder.cc.

116  {
117  double delta_eta = etac - etah;
118  double delta_phi = phic - phih;
119 
120  if (phic < phih)
121  delta_phi = phih - phic;
122  if (delta_phi > M_PI)
123  delta_phi = 2 * M_PI - delta_phi;
124 
125  double tmp = sqrt(delta_eta * delta_eta + delta_phi * delta_phi);
126 
127  edm::LogVerbatim("ValidHcal") << "HcalHitJetFinder::rDist:\n Clus. eta, phi = " << etac << " " << phic
128  << "\n hit eta, phi = " << etah << " " << phih << " rDist = " << tmp;
129 
130  return tmp;
131 }

References HLT_FULL_cff::delta_eta, HLT_FULL_cff::delta_phi, M_PI, mathSSE::sqrt(), and createJobs::tmp.

◆ rDist() [2/2]

double SimG4HcalHitJetFinder::rDist ( const SimG4HcalHitCluster cluster,
const CaloHit hit 
) const

Definition at line 106 of file SimG4HcalHitJetFinder.cc.

106  {
107  double etac = cluster->eta();
108  double phic = cluster->phi();
109 
110  double etah = hit->eta();
111  double phih = hit->phi();
112 
113  return rDist(etac, phic, etah, phih);
114 }

References SimG4HcalHitCluster::eta(), and SimG4HcalHitCluster::phi().

Referenced by SimG4HcalValidation::collectEnergyRdir(), getClusters(), and SimG4HcalValidation::jetAnalysis().

◆ setCone()

void SimG4HcalHitJetFinder::setCone ( double  cone)

Definition at line 17 of file SimG4HcalHitJetFinder.cc.

17 { jetcone = cone; }

References jetcone.

◆ setInput()

void SimG4HcalHitJetFinder::setInput ( std::vector< CaloHit > *  hhit)

Definition at line 19 of file SimG4HcalHitJetFinder.cc.

19 { input = *hhit; }

References input.

Referenced by SimG4HcalValidation::jetAnalysis().

Member Data Documentation

◆ clusvector

std::vector<SimG4HcalHitCluster> SimG4HcalHitJetFinder::clusvector
private

Definition at line 27 of file SimG4HcalHitJetFinder.h.

Referenced by getClusters().

◆ input

std::vector<CaloHit> SimG4HcalHitJetFinder::input
private

Definition at line 26 of file SimG4HcalHitJetFinder.h.

Referenced by getClusters(), and setInput().

◆ jetcone

double SimG4HcalHitJetFinder::jetcone
private

Definition at line 25 of file SimG4HcalHitJetFinder.h.

Referenced by getClusters(), and setCone().

SimG4HcalHitJetFinder::clusvector
std::vector< SimG4HcalHitCluster > clusvector
Definition: SimG4HcalHitJetFinder.h:27
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
HcalBarrel
Definition: HcalAssistant.h:33
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
SimG4HcalHitCluster::eta
double eta() const
Definition: SimG4HcalHitCluster.h:18
SimG4HcalHitJetFinder::input
std::vector< CaloHit > input
Definition: SimG4HcalHitJetFinder.h:26
GetRecoTauVFromDQM_MC_cff.cl
cl
Definition: GetRecoTauVFromDQM_MC_cff.py:38
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
SimG4HcalHitCluster::phi
double phi() const
Definition: SimG4HcalHitCluster.h:19
SimG4HcalHitJetFinder::jetcone
double jetcone
Definition: SimG4HcalHitJetFinder.h:25
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
CaloHit
Definition: CaloHit.h:12
HcalForward
Definition: HcalAssistant.h:36
SimG4HcalHitJetFinder::rDist
double rDist(const SimG4HcalHitCluster *, const CaloHit *) const
Definition: SimG4HcalHitJetFinder.cc:106
HcalEndcap
Definition: HcalAssistant.h:34
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
SimG4HcalHitCluster
Definition: SimG4HcalHitCluster.h:12
HLT_FULL_cff.delta_phi
delta_phi
Definition: HLT_FULL_cff.py:11440
ztail.d
d
Definition: ztail.py:151
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HLT_FULL_cff.delta_eta
delta_eta
Definition: HLT_FULL_cff.py:11439
hit
Definition: SiStripHitEffFromCalibTree.cc:88