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 Attributes
HLTTrack Class Reference

#include <HLTTrack.h>

Public Member Functions

void analyze (const edm::Handle< reco::IsolatedPixelTrackCandidateCollection > &IsoPixelTrackL3, const edm::Handle< reco::IsolatedPixelTrackCandidateCollection > &IsoPixelTrackL2, const edm::Handle< reco::VertexCollection > &pixelVertices, const edm::Handle< reco::RecoChargedCandidateCollection > &PixelTracksL3, const edm::Handle< FEDRawDataCollection > hfedraw, const edm::Handle< edmNew::DetSetVector< SiPixelCluster > > &pixelClusters, TTree *tree)
 
 HLTTrack ()
 
void setup (const edm::ParameterSet &pSet, TTree *tree)
 

Private Attributes

bool _Debug
 
bool _Monte
 
int evtCounter
 
float * isopixeltrackL2dXY
 
float * isopixeltrackL2eta
 
float * isopixeltrackL2pt
 
float * isopixeltrackL3energy
 
float * isopixeltrackL3eta
 
float * isopixeltrackL3maxptpxl
 
float * isopixeltrackL3phi
 
float * isopixeltrackL3pt
 
int nisopixeltrackL3
 
int npixelclusters
 
int npixeltracksL3
 
int pixelfedsize
 
float * pixeltracksL3eta
 
float * pixeltracksL3phi
 
float * pixeltracksL3pt
 
float * pixeltracksL3vz
 

Detailed Description

Definition at line 35 of file HLTTrack.h.

Constructor & Destructor Documentation

HLTTrack::HLTTrack ( )

Definition at line 15 of file HLTTrack.cc.

References _Debug, _Monte, and evtCounter.

15  {
16  evtCounter=0;
17 
18  //set parameter defaults
19  _Monte=false;
20  _Debug=false;
21 }
bool _Monte
Definition: HLTTrack.h:64
int evtCounter
Definition: HLTTrack.h:66
bool _Debug
Definition: HLTTrack.h:64

Member Function Documentation

void HLTTrack::analyze ( const edm::Handle< reco::IsolatedPixelTrackCandidateCollection > &  IsoPixelTrackL3,
const edm::Handle< reco::IsolatedPixelTrackCandidateCollection > &  IsoPixelTrackL2,
const edm::Handle< reco::VertexCollection > &  pixelVertices,
const edm::Handle< reco::RecoChargedCandidateCollection > &  PixelTracksL3,
const edm::Handle< FEDRawDataCollection hfedraw,
const edm::Handle< edmNew::DetSetVector< SiPixelCluster > > &  pixelClusters,
TTree *  tree 
)

Analyze the Data

Definition at line 77 of file HLTTrack.cc.

References deltaR(), FEDRawDataCollection::FEDData(), i, edm::Ref< C, T, F >::isNonnull(), isopixeltrackL2dXY, isopixeltrackL2eta, isopixeltrackL2pt, isopixeltrackL3energy, isopixeltrackL3eta, isopixeltrackL3maxptpxl, isopixeltrackL3phi, isopixeltrackL3pt, edm::HandleBase::isValid(), j, relval_steps::k, HLT_25ns14e33_v1_cff::minDR, nisopixeltrackL3, npixelclusters, npixeltracksL3, HLT_25ns14e33_v1_cff::pixelClusters, pixelfedsize, pixeltracksL3eta, pixeltracksL3phi, pixeltracksL3pt, pixeltracksL3vz, PixelVertexes_cfi::pixelVertices, and FEDRawData::size().

Referenced by HLTAnalyzer::analyze().

84  {
85 
86  //isoPixel
87  if (IsoPixelTrackL3.isValid()) {
88  // Ref to Candidate object to be recorded in filter object
90 
91  nisopixeltrackL3 = IsoPixelTrackL3->size();
92 
93  for (unsigned int i=0; i<IsoPixelTrackL3->size(); i++)
94  {
95  candref = edm::Ref<reco::IsolatedPixelTrackCandidateCollection>(IsoPixelTrackL3, i);
96 
97  isopixeltrackL3maxptpxl[i] = candref->maxPtPxl();
98  isopixeltrackL3pt[i] = candref->pt();
99  isopixeltrackL3eta[i] = candref->track()->eta();
100  isopixeltrackL3phi[i] = candref->phi();
101  isopixeltrackL3energy[i] = (candref->pt())*cosh(candref->track()->eta());
102  }
103  }
104  else {nisopixeltrackL3 = 0;}
105 
106  //minBiasPixel
107  if (PixelTracksL3.isValid()) {
108  // Ref to Candidate object to be recorded in filter object
110 
111  npixeltracksL3 = PixelTracksL3->size();
112 
113  for (unsigned int i=0; i<PixelTracksL3->size(); i++)
114  {
115  candref = edm::Ref<reco::RecoChargedCandidateCollection>(PixelTracksL3, i);
116 
117  pixeltracksL3pt[i] = candref->pt();
118  pixeltracksL3eta[i] = candref->eta();
119  pixeltracksL3phi[i] = candref->phi();
120  pixeltracksL3vz[i] = candref->vz();
121 
122  if (IsoPixelTrackL2.isValid()) {
123  double minDR=100;
126  for (unsigned int j=0; j<IsoPixelTrackL2->size(); j++)
127  {
128  candrefl2 = edm::Ref<reco::IsolatedPixelTrackCandidateCollection>(IsoPixelTrackL2, j);
129  double drL3L2 = deltaR(candrefl2->eta(), candrefl2->phi(),candref->eta(), candref->phi());
130  if (drL3L2<minDR)
131  {
132  candrefl2matched=candrefl2;
133  minDR=drL3L2;
134  }
135  }
136  if (candrefl2matched.isNonnull())
137  {
138  isopixeltrackL2pt[i]=candrefl2matched->pt();
139  isopixeltrackL2eta[i]=candrefl2matched->eta();
140  if (pixelVertices.isValid())
141  {
142  double minDZ=100;
144  edm::Ref<reco::VertexCollection> vertrefMatched;
145  for (unsigned int k=0; k<pixelVertices->size(); k++)
146  {
148  double dz=fabs(candrefl2matched->track()->dz(vertref->position()));
149  if (dz<minDZ)
150  {
151  minDZ=dz;
152  vertrefMatched=vertref;
153  }
154  }
155  if (vertrefMatched.isNonnull()) isopixeltrackL2dXY[i] = candrefl2matched->track()->dxy(vertref->position());
156  else isopixeltrackL2dXY[i]=0;
157  }
158  }
159  }
160  }
161  }
162  else {npixeltracksL3 = 0;}
163 
164  //Pixel FED activity
165  const FEDRawDataCollection theRaw = * hfedraw;
166  int sumoffeds = 0;
167 
168  for (unsigned int i = 0; i <= 39; i++)
169  {
170  sumoffeds = sumoffeds + (theRaw.FEDData(i).size());
171  }
172 
173  pixelfedsize = sumoffeds;
174 
175  npixelclusters = pixelClusters->dataSize();
176 
178 
179 }
int i
Definition: DBlmapReader.cc:9
float * isopixeltrackL3pt
Definition: HLTTrack.h:55
size_type dataSize() const
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:252
float * pixeltracksL3eta
Definition: HLTTrack.h:58
float * pixeltracksL3pt
Definition: HLTTrack.h:58
int nisopixeltrackL3
Definition: HLTTrack.h:56
float * isopixeltrackL3maxptpxl
Definition: HLTTrack.h:55
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
float * isopixeltrackL2pt
Definition: HLTTrack.h:55
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
float * isopixeltrackL2eta
Definition: HLTTrack.h:55
float * isopixeltrackL3eta
Definition: HLTTrack.h:55
float * isopixeltrackL2dXY
Definition: HLTTrack.h:55
int j
Definition: DBlmapReader.cc:9
int npixelclusters
Definition: HLTTrack.h:61
bool isValid() const
Definition: HandleBase.h:75
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
int npixeltracksL3
Definition: HLTTrack.h:59
float * pixeltracksL3vz
Definition: HLTTrack.h:58
float * isopixeltrackL3phi
Definition: HLTTrack.h:55
float * pixeltracksL3phi
Definition: HLTTrack.h:58
float * isopixeltrackL3energy
Definition: HLTTrack.h:55
int pixelfedsize
Definition: HLTTrack.h:60
void HLTTrack::setup ( const edm::ParameterSet pSet,
TTree *  tree 
)

Definition at line 24 of file HLTTrack.cc.

References _Debug, _Monte, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNames(), isopixeltrackL2dXY, isopixeltrackL2eta, isopixeltrackL2pt, isopixeltrackL3energy, isopixeltrackL3eta, isopixeltrackL3maxptpxl, isopixeltrackL3phi, isopixeltrackL3pt, nisopixeltrackL3, npixelclusters, npixeltracksL3, pixelfedsize, pixeltracksL3eta, pixeltracksL3phi, pixeltracksL3pt, and pixeltracksL3vz.

Referenced by HLTAnalyzer::HLTAnalyzer().

24  {
25 
26  edm::ParameterSet myEmParams = pSet.getParameter<edm::ParameterSet>("RunParameters") ;
27  std::vector<std::string> parameterNames = myEmParams.getParameterNames() ;
28 
29  for ( std::vector<std::string>::iterator iParam = parameterNames.begin();
30  iParam != parameterNames.end(); iParam++ ){
31  if ( (*iParam) == "Monte" ) _Monte = myEmParams.getParameter<bool>( *iParam );
32  else if ( (*iParam) == "Debug" ) _Debug = myEmParams.getParameter<bool>( *iParam );
33  }
34 
35  //common
36  const int kMaxTrackL3 = 10000;
37  //isoPixel
38  isopixeltrackL3pt = new float[kMaxTrackL3];
39  isopixeltrackL3eta = new float[kMaxTrackL3];
40  isopixeltrackL3phi = new float[kMaxTrackL3];
41  isopixeltrackL3maxptpxl = new float[kMaxTrackL3];
42  isopixeltrackL3energy = new float[kMaxTrackL3];
43  isopixeltrackL2pt = new float[kMaxTrackL3];
44  isopixeltrackL2eta = new float[kMaxTrackL3];
45  isopixeltrackL2dXY = new float[kMaxTrackL3];
46 
47  //minBiasPixel
48  pixeltracksL3pt = new float[kMaxTrackL3];
49  pixeltracksL3eta = new float[kMaxTrackL3];
50  pixeltracksL3phi = new float[kMaxTrackL3];
51  pixeltracksL3vz = new float[kMaxTrackL3];
52 
53  // Track-specific branches of the tree
54  //isoPixel
55  HltTree->Branch("NohIsoPixelTrackL3",&nisopixeltrackL3,"NohIsoPixelTrackL3/I");
56  HltTree->Branch("ohIsoPixelTrackL3Pt",isopixeltrackL3pt,"ohIsoPixelTrackL3Pt[NohIsoPixelTrackL3]/F");
57  HltTree->Branch("ohIsoPixelTrackL3Eta",isopixeltrackL3eta,"ohIsoPixelTrackL3Eta[NohIsoPixelTrackL3]/F");
58  HltTree->Branch("ohIsoPixelTrackL3Phi",isopixeltrackL3phi,"ohIsoPixelTrackL3Phi[NohIsoPixelTrackL3]/F");
59  HltTree->Branch("ohIsoPixelTrackL3MaxPtPxl",isopixeltrackL3maxptpxl,"ohIsoPixelTrackL3MaxPtPxl[NohIsoPixelTrackL3]/F");
60  HltTree->Branch("ohIsoPixelTrackL3Energy",isopixeltrackL3energy,"ohIsoPixelTrackL3Energy[NohIsoPixelTrackL3]/F");
61  HltTree->Branch("ohIsoPixelTrackL2pt",isopixeltrackL2pt,"ohIsoPixelTrackL2pt[NohIsoPixelTrackL3]/F");
62  HltTree->Branch("ohIsoPixelTrackL2eta",isopixeltrackL2eta,"ohIsoPixelTrackL2eta[NohIsoPixelTrackL3]/F");
63  HltTree->Branch("ohIsoPixelTrackL2dXY",isopixeltrackL2dXY,"ohIsoPixelTrackL2dXY[NohIsoPixelTrackL3]/F");
64 
65  //minBiasPixel
66  HltTree->Branch("NohPixelTracksL3",&npixeltracksL3,"NohPixelTracksL3/I");
67  HltTree->Branch("ohPixelTracksL3Pt",pixeltracksL3pt,"ohPixelTracksL3Pt[NohPixelTracksL3]/F");
68  HltTree->Branch("ohPixelTracksL3Eta",pixeltracksL3eta,"ohPixelTracksL3Eta[NohPixelTracksL3]/F");
69  HltTree->Branch("ohPixelTracksL3Phi",pixeltracksL3phi,"ohPixelTracksL3Phi[NohPixelTracksL3]/F");
70  HltTree->Branch("ohPixelTracksL3Vz",pixeltracksL3vz,"ohPixelTracksL3Vz[NohPixelTracksL3]/F");
71 
72  HltTree->Branch("ohPixelFEDSize",&pixelfedsize,"ohPixelFEDSize/I");
73  HltTree->Branch("NohPixelClusters",&npixelclusters,"NohPixelClusters/I");
74 }
T getParameter(std::string const &) const
float * isopixeltrackL3pt
Definition: HLTTrack.h:55
bool _Monte
Definition: HLTTrack.h:64
float * pixeltracksL3eta
Definition: HLTTrack.h:58
float * pixeltracksL3pt
Definition: HLTTrack.h:58
int nisopixeltrackL3
Definition: HLTTrack.h:56
float * isopixeltrackL3maxptpxl
Definition: HLTTrack.h:55
float * isopixeltrackL2pt
Definition: HLTTrack.h:55
float * isopixeltrackL2eta
Definition: HLTTrack.h:55
float * isopixeltrackL3eta
Definition: HLTTrack.h:55
float * isopixeltrackL2dXY
Definition: HLTTrack.h:55
std::vector< std::string > getParameterNames() const
int npixelclusters
Definition: HLTTrack.h:61
int npixeltracksL3
Definition: HLTTrack.h:59
float * pixeltracksL3vz
Definition: HLTTrack.h:58
float * isopixeltrackL3phi
Definition: HLTTrack.h:55
float * pixeltracksL3phi
Definition: HLTTrack.h:58
float * isopixeltrackL3energy
Definition: HLTTrack.h:55
int pixelfedsize
Definition: HLTTrack.h:60
bool _Debug
Definition: HLTTrack.h:64

Member Data Documentation

bool HLTTrack::_Debug
private

Definition at line 64 of file HLTTrack.h.

Referenced by HLTTrack(), and setup().

bool HLTTrack::_Monte
private

Definition at line 64 of file HLTTrack.h.

Referenced by HLTTrack(), and setup().

int HLTTrack::evtCounter
private

Definition at line 66 of file HLTTrack.h.

Referenced by HLTTrack().

float * HLTTrack::isopixeltrackL2dXY
private

Definition at line 55 of file HLTTrack.h.

Referenced by analyze(), and setup().

float * HLTTrack::isopixeltrackL2eta
private

Definition at line 55 of file HLTTrack.h.

Referenced by analyze(), and setup().

float * HLTTrack::isopixeltrackL2pt
private

Definition at line 55 of file HLTTrack.h.

Referenced by analyze(), and setup().

float * HLTTrack::isopixeltrackL3energy
private

Definition at line 55 of file HLTTrack.h.

Referenced by analyze(), and setup().

float * HLTTrack::isopixeltrackL3eta
private

Definition at line 55 of file HLTTrack.h.

Referenced by analyze(), and setup().

float * HLTTrack::isopixeltrackL3maxptpxl
private

Definition at line 55 of file HLTTrack.h.

Referenced by analyze(), and setup().

float * HLTTrack::isopixeltrackL3phi
private

Definition at line 55 of file HLTTrack.h.

Referenced by analyze(), and setup().

float* HLTTrack::isopixeltrackL3pt
private

Definition at line 55 of file HLTTrack.h.

Referenced by analyze(), and setup().

int HLTTrack::nisopixeltrackL3
private

Definition at line 56 of file HLTTrack.h.

Referenced by analyze(), and setup().

int HLTTrack::npixelclusters
private

Definition at line 61 of file HLTTrack.h.

Referenced by analyze(), and setup().

int HLTTrack::npixeltracksL3
private

Definition at line 59 of file HLTTrack.h.

Referenced by analyze(), and setup().

int HLTTrack::pixelfedsize
private

Definition at line 60 of file HLTTrack.h.

Referenced by analyze(), and setup().

float * HLTTrack::pixeltracksL3eta
private

Definition at line 58 of file HLTTrack.h.

Referenced by analyze(), and setup().

float * HLTTrack::pixeltracksL3phi
private

Definition at line 58 of file HLTTrack.h.

Referenced by analyze(), and setup().

float* HLTTrack::pixeltracksL3pt
private

Definition at line 58 of file HLTTrack.h.

Referenced by analyze(), and setup().

float * HLTTrack::pixeltracksL3vz
private

Definition at line 58 of file HLTTrack.h.

Referenced by analyze(), and setup().