1 |
pellicci |
1.1 |
// -*- C++ -*-
|
2 |
|
|
//
|
3 |
|
|
// Package: TTreeGenerator
|
4 |
|
|
// Class: TTreeGenerator
|
5 |
|
|
//
|
6 |
|
|
/**\class TTreeGenerator TTreeGenerator.cc MyTools/TTreeGenerator/src/TTreeGenerator.cc
|
7 |
|
|
|
8 |
|
|
Description: <one line class summary>
|
9 |
|
|
|
10 |
|
|
Implementation:
|
11 |
|
|
<Notes on implementation>
|
12 |
|
|
*/
|
13 |
|
|
//
|
14 |
|
|
// Original Author: Carlo BATTILANA, Mario PELLICCIONI
|
15 |
|
|
// Created: Mon Jan 11 14:59:51 CET 2010
|
16 |
guiducci |
1.33 |
// $Id: TTreeGenerator.cc,v 1.32 2012/05/28 14:28:30 guiducci Exp $
|
17 |
pellicci |
1.1 |
//
|
18 |
|
|
//
|
19 |
|
|
|
20 |
|
|
// user include files
|
21 |
|
|
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
|
22 |
|
|
|
23 |
|
|
#include "DataFormats/DTDigi/interface/DTDigi.h"
|
24 |
|
|
#include "DataFormats/DTDigi/interface/DTDigiCollection.h"
|
25 |
|
|
#include "DataFormats/DTDigi/interface/DTLocalTriggerCollection.h"
|
26 |
|
|
|
27 |
|
|
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
|
28 |
|
|
|
29 |
|
|
#include "DataFormats/GeometrySurface/interface/Cylinder.h"
|
30 |
|
|
|
31 |
|
|
#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h"
|
32 |
gmasetti |
1.15 |
#include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambThContainer.h"
|
33 |
pellicci |
1.1 |
#include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTReadoutCollection.h"
|
34 |
|
|
|
35 |
battilan |
1.17 |
#include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
|
36 |
pellicci |
1.22 |
|
37 |
pellicci |
1.28 |
#include "DataFormats/Luminosity/interface/LumiDetails.h"
|
38 |
|
|
|
39 |
battilan |
1.17 |
#include "CondFormats/L1TObjects/interface/L1GtTriggerMenu.h"
|
40 |
|
|
#include "CondFormats/DataRecord/interface/L1GtTriggerMenuRcd.h"
|
41 |
|
|
|
42 |
pellicci |
1.1 |
#include "DataFormats/MuonReco/interface/Muon.h"
|
43 |
|
|
#include "DataFormats/MuonReco/interface/MuonFwd.h"
|
44 |
|
|
|
45 |
|
|
#include "DataFormats/TrackReco/interface/Track.h"
|
46 |
|
|
|
47 |
|
|
#include "DataFormats/Common/interface/TriggerResults.h"
|
48 |
|
|
|
49 |
pellicci |
1.26 |
#include "DataFormats/Scalers/interface/LumiScalers.h"
|
50 |
|
|
|
51 |
pellicci |
1.1 |
#include "DataFormats/VertexReco/interface/Vertex.h"
|
52 |
|
|
#include "DataFormats/VertexReco/interface/VertexFwd.h"
|
53 |
|
|
|
54 |
pellicci |
1.3 |
#include "FWCore/Common/interface/TriggerNames.h"
|
55 |
pellicci |
1.1 |
#include "FWCore/Framework/interface/MakerMacros.h"
|
56 |
pellicci |
1.22 |
#include "FWCore/Framework/interface/LuminosityBlock.h"
|
57 |
pellicci |
1.1 |
|
58 |
|
|
#include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
|
59 |
|
|
#include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
|
60 |
|
|
#include "Geometry/CommonDetUnit/interface/GeomDet.h"
|
61 |
|
|
|
62 |
|
|
#include "MagneticField/Engine/interface/MagneticField.h"
|
63 |
|
|
|
64 |
|
|
#include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
|
65 |
|
|
|
66 |
|
|
#include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
|
67 |
|
|
#include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
|
68 |
|
|
|
69 |
guiducci |
1.32 |
#include <DataFormats/RPCDigi/interface/RPCDigiCollection.h>
|
70 |
|
|
#include <DataFormats/RPCRecHit/interface/RPCRecHitCollection.h>
|
71 |
|
|
#include <DataFormats/MuonDetId/interface/RPCDetId.h>
|
72 |
|
|
|
73 |
|
|
|
74 |
pellicci |
1.2 |
#include "UserCode/DTDPGAnalysis/interface/TTreeGenerator.h"
|
75 |
guiducci |
1.31 |
#include <iostream>
|
76 |
guiducci |
1.32 |
|
77 |
|
|
|
78 |
pellicci |
1.1 |
TTreeGenerator::TTreeGenerator(const edm::ParameterSet& pset)
|
79 |
|
|
{
|
80 |
|
|
//get parameters from the configuration file
|
81 |
|
|
//names of the different event collections
|
82 |
|
|
dtDigiLabel_ = pset.getParameter<edm::InputTag>("dtDigiLabel");
|
83 |
|
|
dtSegmentLabel_ = pset.getParameter<edm::InputTag>("dtSegmentLabel");
|
84 |
|
|
cscSegmentLabel_ = pset.getParameter<edm::InputTag>("cscSegmentLabel");
|
85 |
|
|
dtTrigDCCLabel_ = pset.getParameter<edm::InputTag>("dtTrigDCCLabel");
|
86 |
guiducci |
1.31 |
dtTrigSimDCCLabel_ = pset.getParameter<edm::InputTag>("dtTrigSimDCCLabel");
|
87 |
pellicci |
1.1 |
dtTrigDDULabel_ = pset.getParameter<edm::InputTag>("dtTrigDDULabel");
|
88 |
|
|
staMuLabel_ = pset.getParameter<edm::InputTag>("staMuLabel");
|
89 |
|
|
gmtLabel_ = pset.getParameter<edm::InputTag>("gmtLabel");
|
90 |
|
|
triggerTag_ = pset.getParameter<edm::InputTag>("TriggerTag");
|
91 |
battilan |
1.17 |
gtLabel_ = pset.getParameter<edm::InputTag>("gtLabel");
|
92 |
guiducci |
1.32 |
rpcRecHitLabel_ = pset.getParameter<edm::InputTag>("rpcRecHitLabel");
|
93 |
pellicci |
1.1 |
|
94 |
|
|
//max size of the different saved objects (per event)
|
95 |
|
|
digisSize_ = pset.getParameter<int>("dtDigiSize");
|
96 |
|
|
dtsegmentsSize_ = pset.getParameter<int>("dtSegmentSize");
|
97 |
|
|
cscsegmentsSize_ = pset.getParameter<int>("cscSegmentSize");
|
98 |
|
|
dtltDCCSize_ = pset.getParameter<int>("dtTrigDCCSize");
|
99 |
gmasetti |
1.15 |
dtltDCCThSize_ = pset.getParameter<int>("dtTrigDCCThSize");
|
100 |
guiducci |
1.31 |
dtltSimDCCSize_ = pset.getParameter<int>("dtTrigSimDCCSize");
|
101 |
|
|
dtltSimDCCThSize_ = pset.getParameter<int>("dtTrigSimDCCThSize");
|
102 |
pellicci |
1.1 |
dtltDDUSize_ = pset.getParameter<int>("dtTrigDDUSize");
|
103 |
|
|
gmtSize_ = pset.getParameter<int>("gmtSize");
|
104 |
|
|
STAMuSize_ = pset.getParameter<int>("STAMuSize");
|
105 |
guiducci |
1.32 |
rpcRecHitSize_ = pset.getParameter<int>("rpcRecHitSize");
|
106 |
pellicci |
1.1 |
|
107 |
pellicci |
1.26 |
PrimaryVertexTag_ = pset.getParameter<edm::InputTag>("PrimaryVertexTag");
|
108 |
|
|
beamSpotTag_ = pset.getParameter<edm::InputTag>("beamSpotTag");
|
109 |
|
|
scalersSource_ = pset.getParameter<edm::InputTag>("scalersResults");
|
110 |
pellicci |
1.1 |
|
111 |
pellicci |
1.26 |
runOnRaw_ = pset.getParameter<bool>("runOnRaw");
|
112 |
|
|
runOnSimulation_ = pset.getParameter<bool>("runOnSimulation");
|
113 |
battilan |
1.14 |
|
114 |
pellicci |
1.26 |
outFile_ = pset.getParameter<std::string>("outputFile");
|
115 |
pellicci |
1.4 |
|
116 |
pellicci |
1.1 |
initialize_Tree_variables();
|
117 |
|
|
|
118 |
|
|
//counters
|
119 |
|
|
idigis = 0;
|
120 |
|
|
idtsegments = 0;
|
121 |
|
|
icscsegments = 0;
|
122 |
|
|
idtltDCC = 0;
|
123 |
gmasetti |
1.15 |
idtltDCC_th = 0;
|
124 |
guiducci |
1.31 |
idtltSimDCC = 0;
|
125 |
|
|
idtltSimDCC_th = 0;
|
126 |
pellicci |
1.1 |
idtltDDU = 0;
|
127 |
|
|
imuons = 0;
|
128 |
|
|
igmtdt = 0;
|
129 |
|
|
igmtcands = 0;
|
130 |
pellicci |
1.25 |
igtalgo = 0;
|
131 |
|
|
igttt = 0;
|
132 |
|
|
ihlt = 0;
|
133 |
pellicci |
1.1 |
}
|
134 |
|
|
|
135 |
|
|
void TTreeGenerator::analyze(const edm::Event& event, const edm::EventSetup& context)
|
136 |
|
|
{
|
137 |
pellicci |
1.9 |
//retrieve the beamspot info
|
138 |
|
|
edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
|
139 |
|
|
event.getByLabel(beamSpotTag_ ,recoBeamSpotHandle);
|
140 |
|
|
beamspot = *recoBeamSpotHandle;
|
141 |
|
|
|
142 |
pellicci |
1.26 |
//retrieve the luminosity
|
143 |
|
|
edm::Handle<LumiScalersCollection> lumiScalers;
|
144 |
|
|
event.getByLabel(scalersSource_, lumiScalers);
|
145 |
|
|
LumiScalersCollection::const_iterator lumiIt = lumiScalers->begin();
|
146 |
|
|
lumiperblock = lumiIt->instantLumi();
|
147 |
|
|
|
148 |
pellicci |
1.1 |
//retrieve the collections you are interested on in the event
|
149 |
|
|
edm::Handle<DTDigiCollection> dtdigis;
|
150 |
pellicci |
1.21 |
if(runOnRaw_ && !runOnSimulation_) event.getByLabel(dtDigiLabel_, dtdigis);
|
151 |
pellicci |
1.1 |
|
152 |
|
|
edm::Handle<DTRecSegment4DCollection> dtsegments4D;
|
153 |
|
|
event.getByLabel(dtSegmentLabel_, dtsegments4D);
|
154 |
|
|
|
155 |
|
|
context.get<GlobalTrackingGeometryRecord>().get(theTrackingGeometry);
|
156 |
|
|
|
157 |
|
|
edm::Handle<reco::VertexCollection> privtxs;
|
158 |
|
|
event.getByLabel(PrimaryVertexTag_, privtxs);
|
159 |
|
|
|
160 |
|
|
edm::Handle<CSCSegmentCollection> cscsegments;
|
161 |
|
|
event.getByLabel(cscSegmentLabel_, cscsegments);
|
162 |
|
|
|
163 |
|
|
edm::Handle<L1MuDTChambPhContainer> localTriggerDCC;
|
164 |
pellicci |
1.4 |
if(runOnRaw_) event.getByLabel(dtTrigDCCLabel_,localTriggerDCC);
|
165 |
pellicci |
1.1 |
|
166 |
gmasetti |
1.15 |
edm::Handle<L1MuDTChambThContainer> localTriggerDCC_Th;
|
167 |
|
|
if(runOnRaw_) event.getByLabel(dtTrigDCCLabel_,localTriggerDCC_Th);
|
168 |
|
|
|
169 |
guiducci |
1.31 |
edm::Handle<L1MuDTChambPhContainer> localTriggerSimDCC;
|
170 |
|
|
if(runOnRaw_) event.getByLabel(dtTrigSimDCCLabel_,localTriggerSimDCC);
|
171 |
|
|
|
172 |
|
|
edm::Handle<L1MuDTChambThContainer> localTriggerSimDCC_Th;
|
173 |
|
|
if(runOnRaw_) event.getByLabel(dtTrigSimDCCLabel_,localTriggerSimDCC_Th);
|
174 |
|
|
|
175 |
pellicci |
1.1 |
edm::Handle<DTLocalTriggerCollection> localTriggerDDU;
|
176 |
battilan |
1.14 |
if(runOnRaw_ && !runOnSimulation_) event.getByLabel(dtTrigDDULabel_,localTriggerDDU);
|
177 |
pellicci |
1.1 |
|
178 |
|
|
edm::Handle<reco::MuonCollection> MuList;
|
179 |
|
|
event.getByLabel(staMuLabel_,MuList);
|
180 |
|
|
|
181 |
|
|
edm::Handle<L1MuGMTReadoutCollection> gmtrc;
|
182 |
pellicci |
1.4 |
if(runOnRaw_) event.getByLabel(gmtLabel_,gmtrc);
|
183 |
pellicci |
1.1 |
|
184 |
battilan |
1.17 |
edm::Handle< L1GlobalTriggerReadoutRecord > gtrc;
|
185 |
|
|
if(runOnRaw_) event.getByLabel(gtLabel_, gtrc);
|
186 |
|
|
|
187 |
|
|
edm::ESHandle<L1GtTriggerMenu> menuRcd;
|
188 |
|
|
context.get<L1GtTriggerMenuRcd>().get(menuRcd) ;
|
189 |
|
|
const L1GtTriggerMenu* menu = menuRcd.product();
|
190 |
|
|
|
191 |
|
|
edm::Handle<edm::TriggerResults> hltresults;
|
192 |
|
|
event.getByLabel(triggerTag_, hltresults);
|
193 |
|
|
|
194 |
guiducci |
1.32 |
edm::Handle<RPCRecHitCollection> rpcHits;
|
195 |
|
|
event.getByLabel(rpcRecHitLabel_,rpcHits);
|
196 |
|
|
|
197 |
pellicci |
1.1 |
//clear the containers
|
198 |
|
|
clear_Arrays();
|
199 |
|
|
|
200 |
|
|
// Get the propagators
|
201 |
|
|
context.get<TrackingComponentsRecord>().get("SmartPropagatorAny",propagatorAlong);
|
202 |
|
|
context.get<TrackingComponentsRecord>().get("SmartPropagatorAnyOpposite", propagatorOpposite);
|
203 |
|
|
|
204 |
guiducci |
1.30 |
//get the magnetic field
|
205 |
|
|
context.get<IdealMagneticFieldRecord>().get(theBField);
|
206 |
|
|
|
207 |
pellicci |
1.1 |
//Fill the event info block
|
208 |
|
|
runnumber = event.run();
|
209 |
|
|
lumiblock = event.getLuminosityBlock().luminosityBlock();
|
210 |
|
|
eventNumber = event.eventAuxiliary().event();
|
211 |
|
|
timestamp = event.eventAuxiliary().time().value();
|
212 |
|
|
bunchXing = event.eventAuxiliary().bunchCrossing();
|
213 |
|
|
orbitNum = event.eventAuxiliary().orbitNumber();
|
214 |
|
|
|
215 |
pellicci |
1.28 |
edm::Handle<LumiDetails> lumiDetails;
|
216 |
|
|
event.getLuminosityBlock().getByLabel("lumiProducer", lumiDetails);
|
217 |
pellicci |
1.29 |
if(lumiDetails->isValid()){
|
218 |
|
|
beam1Intensity = lumiDetails->lumiBeam1Intensity(bunchXing);
|
219 |
|
|
beam2Intensity = lumiDetails->lumiBeam2Intensity(bunchXing);
|
220 |
|
|
}
|
221 |
pellicci |
1.28 |
|
222 |
pellicci |
1.1 |
//Primary vertex
|
223 |
|
|
if((*privtxs).size() != 0){
|
224 |
|
|
PV_x = (*privtxs)[0].position().x();
|
225 |
|
|
PV_y = (*privtxs)[0].position().y();
|
226 |
|
|
PV_z = (*privtxs)[0].position().z();
|
227 |
|
|
|
228 |
|
|
PV_xxE = (*privtxs)[0].covariance(0,0);
|
229 |
|
|
PV_yyE = (*privtxs)[0].covariance(1,1);
|
230 |
|
|
PV_zzE = (*privtxs)[0].covariance(2,2);
|
231 |
|
|
PV_xyE = (*privtxs)[0].covariance(0,1);
|
232 |
|
|
PV_xzE = (*privtxs)[0].covariance(0,2);
|
233 |
|
|
PV_yzE = (*privtxs)[0].covariance(1,2);
|
234 |
|
|
|
235 |
|
|
PV_normchi2 = (*privtxs)[0].chi2()/(*privtxs)[0].ndof();
|
236 |
pellicci |
1.29 |
|
237 |
|
|
PV_Nvtx = (*privtxs).size();
|
238 |
pellicci |
1.1 |
}
|
239 |
|
|
else{
|
240 |
|
|
PV_x = -999.;
|
241 |
|
|
PV_y = -999.;
|
242 |
|
|
PV_z = -999.;
|
243 |
|
|
PV_xxE = -999.;
|
244 |
|
|
PV_yyE = -999.;
|
245 |
|
|
PV_zzE = -999.;
|
246 |
|
|
PV_xyE = -999.;
|
247 |
|
|
PV_xzE = -999.;
|
248 |
|
|
PV_yzE = -999.;
|
249 |
|
|
PV_normchi2 = -999.;
|
250 |
pellicci |
1.29 |
PV_Nvtx = -999;
|
251 |
pellicci |
1.1 |
}
|
252 |
|
|
|
253 |
|
|
//DIGIS
|
254 |
pellicci |
1.21 |
if(runOnRaw_ && !runOnSimulation_) fill_digi_variables(dtdigis);
|
255 |
pellicci |
1.1 |
|
256 |
|
|
//DT SEGMENTS
|
257 |
|
|
fill_dtsegments_variables(dtsegments4D);
|
258 |
|
|
|
259 |
|
|
//CSC SEGMENTS
|
260 |
|
|
fill_cscsegments_variables(cscsegments);
|
261 |
|
|
|
262 |
|
|
//DCC
|
263 |
pellicci |
1.4 |
if(runOnRaw_) fill_dcc_variables(localTriggerDCC);
|
264 |
gmasetti |
1.15 |
if(runOnRaw_) fill_dccth_variables(localTriggerDCC_Th);
|
265 |
guiducci |
1.31 |
if(runOnRaw_) fill_simdcc_variables(localTriggerSimDCC);
|
266 |
|
|
if(runOnRaw_) fill_simdccth_variables(localTriggerSimDCC_Th);
|
267 |
pellicci |
1.1 |
|
268 |
|
|
//DDU
|
269 |
battilan |
1.14 |
if(runOnRaw_ && !runOnSimulation_) fill_ddu_variables(localTriggerDDU);
|
270 |
pellicci |
1.1 |
|
271 |
|
|
//MUONS
|
272 |
|
|
fill_muons_variables(MuList);
|
273 |
|
|
|
274 |
|
|
//GMT
|
275 |
pellicci |
1.4 |
if(runOnRaw_) fill_gmt_variables(gmtrc);
|
276 |
pellicci |
1.1 |
|
277 |
battilan |
1.17 |
//GT
|
278 |
|
|
if(runOnRaw_) fill_gt_variables(gtrc,menu);
|
279 |
|
|
|
280 |
|
|
//HLT
|
281 |
|
|
fill_hlt_variables(event,hltresults);
|
282 |
|
|
|
283 |
guiducci |
1.32 |
// RPC
|
284 |
|
|
fill_rpc_variables(event,rpcHits);
|
285 |
|
|
|
286 |
pellicci |
1.1 |
tree_->Fill();
|
287 |
|
|
|
288 |
|
|
return;
|
289 |
|
|
}
|
290 |
|
|
|
291 |
|
|
void TTreeGenerator::fill_digi_variables(edm::Handle<DTDigiCollection> dtdigis)
|
292 |
|
|
{
|
293 |
|
|
idigis = 0;
|
294 |
|
|
|
295 |
|
|
for (DTDigiCollection::DigiRangeIterator dtLayerIdIt = dtdigis->begin(); dtLayerIdIt!=dtdigis->end(); dtLayerIdIt++){
|
296 |
|
|
|
297 |
|
|
for (DTDigiCollection::const_iterator digiIt = ((*dtLayerIdIt).second).first;digiIt!=((*dtLayerIdIt).second).second; ++digiIt){
|
298 |
|
|
|
299 |
|
|
if(idigis >= digisSize_) return;
|
300 |
|
|
|
301 |
|
|
digi_wheel.push_back((*dtLayerIdIt).first.wheel());
|
302 |
|
|
digi_sector.push_back((*dtLayerIdIt).first.sector());
|
303 |
|
|
digi_station.push_back((*dtLayerIdIt).first.station());
|
304 |
|
|
digi_sl.push_back((*dtLayerIdIt).first.superLayer());
|
305 |
|
|
digi_layer.push_back((*dtLayerIdIt).first.layer());
|
306 |
|
|
|
307 |
|
|
digi_wire.push_back((*digiIt).wire());
|
308 |
|
|
digi_time.push_back((*digiIt).time());
|
309 |
|
|
|
310 |
|
|
idigis++;
|
311 |
|
|
}
|
312 |
|
|
}
|
313 |
|
|
|
314 |
|
|
return;
|
315 |
|
|
}
|
316 |
|
|
|
317 |
|
|
void TTreeGenerator::fill_dtsegments_variables(edm::Handle<DTRecSegment4DCollection> segments4D)
|
318 |
|
|
{
|
319 |
|
|
idtsegments = 0;
|
320 |
|
|
|
321 |
|
|
static TVectorF dummyfloat(1); dummyfloat(0) = -999.;
|
322 |
|
|
|
323 |
|
|
for (DTRecSegment4DCollection::id_iterator chambIt = segments4D->id_begin(); chambIt != segments4D->id_end(); ++chambIt){
|
324 |
|
|
|
325 |
|
|
DTRecSegment4DCollection::range range = segments4D->get(*chambIt);
|
326 |
|
|
for (DTRecSegment4DCollection::const_iterator segment4D = range.first; segment4D!=range.second; ++segment4D){
|
327 |
|
|
|
328 |
|
|
if(idtsegments >= dtsegmentsSize_) return;
|
329 |
|
|
|
330 |
|
|
segm4D_wheel.push_back((*chambIt).wheel());
|
331 |
|
|
segm4D_sector.push_back((*chambIt).sector());
|
332 |
|
|
segm4D_station.push_back((*chambIt).station());
|
333 |
|
|
|
334 |
|
|
const bool hasPhi = segment4D->hasPhi();
|
335 |
|
|
const bool hasZed = segment4D->hasZed();
|
336 |
dtdqm |
1.19 |
segm4D_hasPhi.push_back(hasPhi);
|
337 |
|
|
segm4D_hasZed.push_back(hasZed);
|
338 |
pellicci |
1.1 |
|
339 |
battilan |
1.11 |
segm4D_x_pos_loc.push_back(segment4D->localPosition().x());
|
340 |
|
|
segm4D_y_pos_loc.push_back(segment4D->localPosition().y());
|
341 |
|
|
segm4D_z_pos_loc.push_back(segment4D->localPosition().x());
|
342 |
|
|
segm4D_x_dir_loc.push_back(segment4D->localDirection().x());
|
343 |
|
|
segm4D_y_dir_loc.push_back(segment4D->localDirection().y());
|
344 |
|
|
segm4D_z_dir_loc.push_back(segment4D->localDirection().z());
|
345 |
pellicci |
1.1 |
|
346 |
pellicci |
1.25 |
const GeomDet* geomDet = theTrackingGeometry->idToDet(segment4D->geographicalId());
|
347 |
pellicci |
1.8 |
const GlobalVector point_glb = geomDet->toGlobal(segment4D->localDirection());
|
348 |
pellicci |
1.1 |
|
349 |
pellicci |
1.8 |
segm4D_cosx.push_back(point_glb.x());
|
350 |
|
|
segm4D_cosy.push_back(point_glb.y());
|
351 |
|
|
segm4D_cosz.push_back(point_glb.z());
|
352 |
pellicci |
1.9 |
segm4D_phi.push_back(point_glb.phi());
|
353 |
|
|
segm4D_theta.push_back(point_glb.theta());
|
354 |
|
|
segm4D_eta.push_back(point_glb.eta());
|
355 |
pellicci |
1.1 |
|
356 |
battilan |
1.24 |
if(hasPhi) fill_dtphi_info(segment4D->phiSegment(),geomDet);
|
357 |
pellicci |
1.1 |
else{
|
358 |
|
|
segm4D_t0.push_back(-999.);
|
359 |
dtdqm |
1.16 |
segm4D_vdrift.push_back(-999.);
|
360 |
pellicci |
1.1 |
segm4D_phinormchi2.push_back(-999.);
|
361 |
|
|
segm4D_phinhits.push_back(-999);
|
362 |
|
|
|
363 |
|
|
new ((*segm4D_phiHits_Pos)[idtsegments]) TVectorF(dummyfloat);
|
364 |
battilan |
1.24 |
new ((*segm4D_phiHits_PosCh)[idtsegments]) TVectorF(dummyfloat);
|
365 |
pellicci |
1.1 |
new ((*segm4D_phiHits_PosErr)[idtsegments]) TVectorF(dummyfloat);
|
366 |
|
|
new ((*segm4D_phiHits_Side)[idtsegments]) TVectorF(dummyfloat);
|
367 |
pellicci |
1.23 |
new ((*segm4D_phiHits_Wire)[idtsegments]) TVectorF(dummyfloat);
|
368 |
|
|
new ((*segm4D_phiHits_Layer)[idtsegments]) TVectorF(dummyfloat);
|
369 |
|
|
}
|
370 |
pellicci |
1.1 |
|
371 |
battilan |
1.24 |
if(hasZed) fill_dtz_info(segment4D->zSegment(),geomDet);
|
372 |
pellicci |
1.1 |
else{
|
373 |
|
|
segm4D_znormchi2.push_back(-999.);
|
374 |
|
|
segm4D_znhits.push_back(-999);
|
375 |
|
|
|
376 |
|
|
new ((*segm4D_zHits_Pos)[idtsegments]) TVectorF(dummyfloat);
|
377 |
battilan |
1.24 |
new ((*segm4D_zHits_PosCh)[idtsegments]) TVectorF(dummyfloat);
|
378 |
pellicci |
1.1 |
new ((*segm4D_zHits_PosErr)[idtsegments]) TVectorF(dummyfloat);
|
379 |
|
|
new ((*segm4D_zHits_Side)[idtsegments]) TVectorF(dummyfloat);
|
380 |
pellicci |
1.23 |
new ((*segm4D_zHits_Wire)[idtsegments]) TVectorF(dummyfloat);
|
381 |
battilan |
1.24 |
new ((*segm4D_zHits_Layer)[idtsegments]) TVectorF(dummyfloat);
|
382 |
pellicci |
1.1 |
}
|
383 |
|
|
|
384 |
|
|
idtsegments++;
|
385 |
|
|
}
|
386 |
|
|
}
|
387 |
|
|
|
388 |
|
|
return;
|
389 |
|
|
}
|
390 |
|
|
|
391 |
battilan |
1.24 |
void TTreeGenerator::fill_dtphi_info(const DTChamberRecSegment2D* phiSeg, const GeomDet* chamb)
|
392 |
pellicci |
1.1 |
{
|
393 |
|
|
std::vector<DTRecHit1D> phirecHitslist = phiSeg->specificRecHits();
|
394 |
|
|
|
395 |
|
|
//segment information
|
396 |
|
|
segm4D_t0.push_back(phiSeg->t0());
|
397 |
dtdqm |
1.16 |
segm4D_vdrift.push_back(phiSeg->vDrift());
|
398 |
|
|
|
399 |
pellicci |
1.1 |
segm4D_phinormchi2.push_back(phiSeg->chi2()/phiSeg->degreesOfFreedom());
|
400 |
|
|
|
401 |
|
|
//rechits information
|
402 |
|
|
const int nphirecHits = phirecHitslist.size();
|
403 |
|
|
segm4D_phinhits.push_back(nphirecHits);
|
404 |
|
|
|
405 |
|
|
TVectorF phiPosRechits(nphirecHits);
|
406 |
battilan |
1.24 |
TVectorF phiPosChRechits(nphirecHits);
|
407 |
pellicci |
1.1 |
TVectorF phiPosErrRechits(nphirecHits);
|
408 |
|
|
TVectorF phiSideRechits(nphirecHits);
|
409 |
pellicci |
1.23 |
TVectorF phiwireRechits(nphirecHits);
|
410 |
|
|
TVectorF philayerRechits(nphirecHits);
|
411 |
|
|
|
412 |
pellicci |
1.1 |
int rechitscounter = 0;
|
413 |
|
|
for(std::vector<DTRecHit1D>::const_iterator recHitsIt = phirecHitslist.begin(); recHitsIt!=phirecHitslist.end(); ++recHitsIt){
|
414 |
battilan |
1.24 |
const GeomDet * layer = theTrackingGeometry->idToDet(recHitsIt->wireId().layerId());
|
415 |
pellicci |
1.1 |
phiPosRechits(rechitscounter) = recHitsIt->localPosition().x();
|
416 |
battilan |
1.24 |
phiPosChRechits(rechitscounter) = chamb->toLocal(layer->toGlobal(recHitsIt->localPosition())).x();
|
417 |
pellicci |
1.1 |
phiPosErrRechits(rechitscounter) = recHitsIt->localPositionError().xx();
|
418 |
|
|
phiSideRechits(rechitscounter) = recHitsIt->lrSide();
|
419 |
pellicci |
1.23 |
phiwireRechits(rechitscounter) = recHitsIt->wireId().wire();
|
420 |
|
|
philayerRechits(rechitscounter) = recHitsIt->wireId().layerId().layer();
|
421 |
pellicci |
1.1 |
rechitscounter++;
|
422 |
|
|
}
|
423 |
|
|
|
424 |
|
|
new ((*segm4D_phiHits_Pos)[idtsegments]) TVectorF(phiPosRechits);
|
425 |
battilan |
1.24 |
new ((*segm4D_phiHits_PosCh)[idtsegments]) TVectorF(phiPosChRechits);
|
426 |
pellicci |
1.1 |
new ((*segm4D_phiHits_PosErr)[idtsegments]) TVectorF(phiPosErrRechits);
|
427 |
|
|
new ((*segm4D_phiHits_Side)[idtsegments]) TVectorF(phiSideRechits);
|
428 |
pellicci |
1.23 |
new ((*segm4D_phiHits_Wire)[idtsegments]) TVectorF(phiwireRechits);
|
429 |
|
|
new ((*segm4D_phiHits_Layer)[idtsegments]) TVectorF(philayerRechits);
|
430 |
pellicci |
1.1 |
|
431 |
|
|
return;
|
432 |
|
|
}
|
433 |
|
|
|
434 |
battilan |
1.24 |
void TTreeGenerator::fill_dtz_info(const DTSLRecSegment2D* zSeg, const GeomDet* chamb)
|
435 |
pellicci |
1.1 |
{
|
436 |
|
|
std::vector<DTRecHit1D> zrecHitslist = zSeg->specificRecHits();
|
437 |
|
|
|
438 |
|
|
segm4D_znormchi2.push_back(zSeg->chi2()/zSeg->degreesOfFreedom());
|
439 |
|
|
|
440 |
|
|
//rechits information
|
441 |
|
|
const int nzrecHits = zrecHitslist.size();
|
442 |
|
|
segm4D_znhits.push_back(nzrecHits);
|
443 |
|
|
|
444 |
|
|
TVectorF zPosRechits(nzrecHits);
|
445 |
battilan |
1.24 |
TVectorF zPosChRechits(nzrecHits);
|
446 |
pellicci |
1.1 |
TVectorF zPosErrRechits(nzrecHits);
|
447 |
|
|
TVectorF zSideRechits(nzrecHits);
|
448 |
pellicci |
1.23 |
TVectorF zwireRechits(nzrecHits);
|
449 |
|
|
TVectorF zlayerRechits(nzrecHits);
|
450 |
|
|
|
451 |
pellicci |
1.1 |
int rechitscounter = 0;
|
452 |
|
|
for(std::vector<DTRecHit1D>::const_iterator recHitsIt = zrecHitslist.begin(); recHitsIt!=zrecHitslist.end(); ++recHitsIt){
|
453 |
battilan |
1.24 |
const GeomDet * layer = theTrackingGeometry->idToDet(recHitsIt->wireId().layerId());
|
454 |
pellicci |
1.1 |
zPosRechits(rechitscounter) = recHitsIt->localPosition().y();
|
455 |
battilan |
1.24 |
zPosChRechits(rechitscounter) = chamb->toLocal(layer->toGlobal(recHitsIt->localPosition())).y();
|
456 |
pellicci |
1.1 |
zPosErrRechits(rechitscounter) = recHitsIt->localPositionError().yy();
|
457 |
|
|
zSideRechits(rechitscounter) = recHitsIt->lrSide();
|
458 |
pellicci |
1.23 |
zwireRechits(rechitscounter) = recHitsIt->wireId().wire();
|
459 |
|
|
zlayerRechits(rechitscounter) = recHitsIt->wireId().layerId().layer();
|
460 |
pellicci |
1.1 |
rechitscounter++;
|
461 |
|
|
}
|
462 |
|
|
|
463 |
|
|
new ((*segm4D_zHits_Pos)[idtsegments]) TVectorF(zPosRechits);
|
464 |
battilan |
1.24 |
new ((*segm4D_zHits_PosCh)[idtsegments]) TVectorF(zPosChRechits);
|
465 |
pellicci |
1.1 |
new ((*segm4D_zHits_PosErr)[idtsegments]) TVectorF(zPosErrRechits);
|
466 |
|
|
new ((*segm4D_zHits_Side)[idtsegments]) TVectorF(zSideRechits);
|
467 |
pellicci |
1.23 |
new ((*segm4D_zHits_Wire)[idtsegments]) TVectorF(zwireRechits);
|
468 |
|
|
new ((*segm4D_zHits_Layer)[idtsegments]) TVectorF(zlayerRechits);
|
469 |
pellicci |
1.1 |
|
470 |
|
|
return;
|
471 |
|
|
}
|
472 |
|
|
|
473 |
|
|
void TTreeGenerator::fill_cscsegments_variables(edm::Handle<CSCSegmentCollection> cscsegments)
|
474 |
|
|
{
|
475 |
|
|
icscsegments = 0;
|
476 |
|
|
for (CSCSegmentCollection::id_iterator chambIt = cscsegments->id_begin(); chambIt != cscsegments->id_end(); ++chambIt){
|
477 |
|
|
|
478 |
|
|
CSCSegmentCollection::range range = cscsegments->get(*chambIt);
|
479 |
|
|
for (CSCSegmentCollection::const_iterator cscsegment = range.first; cscsegment!=range.second; ++cscsegment){
|
480 |
|
|
|
481 |
|
|
if(icscsegments >= cscsegmentsSize_) return;
|
482 |
|
|
|
483 |
|
|
cscsegm_ring.push_back((*chambIt).ring());
|
484 |
|
|
cscsegm_chamber.push_back((*chambIt).chamber());
|
485 |
|
|
cscsegm_station.push_back((*chambIt).station());
|
486 |
|
|
|
487 |
|
|
const GeomDet* geomDet = theTrackingGeometry->idToDet(cscsegment->geographicalId());
|
488 |
|
|
|
489 |
pellicci |
1.8 |
const GlobalVector point_glb = geomDet->toGlobal(cscsegment->localDirection());
|
490 |
|
|
|
491 |
|
|
cscsegm_cosx.push_back(point_glb.x());
|
492 |
|
|
cscsegm_cosy.push_back(point_glb.y());
|
493 |
|
|
cscsegm_cosz.push_back(point_glb.y());
|
494 |
|
|
|
495 |
pellicci |
1.1 |
|
496 |
|
|
cscsegm_normchi2.push_back(cscsegment->chi2()/cscsegment->degreesOfFreedom());
|
497 |
|
|
cscsegm_nRecHits.push_back(cscsegment->nRecHits());
|
498 |
|
|
|
499 |
|
|
icscsegments++;
|
500 |
|
|
}
|
501 |
|
|
}
|
502 |
|
|
|
503 |
|
|
return;
|
504 |
|
|
}
|
505 |
|
|
|
506 |
|
|
void TTreeGenerator::fill_dcc_variables(edm::Handle<L1MuDTChambPhContainer> localTriggerDCC)
|
507 |
|
|
{
|
508 |
guiducci |
1.31 |
|
509 |
pellicci |
1.1 |
idtltDCC = 0;
|
510 |
|
|
std::vector<L1MuDTChambPhDigi>* phTrigs = localTriggerDCC->getContainer();
|
511 |
|
|
for(std::vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin(); iph != phTrigs->end() ; ++iph){
|
512 |
|
|
if(idtltDCC >= dtltDCCSize_) break;
|
513 |
|
|
ltDCC_wheel.push_back(iph->whNum());
|
514 |
|
|
ltDCC_sector.push_back(iph->scNum() + 1); // DTTF[0-11] -> DT[1-12] Sector Numbering
|
515 |
|
|
ltDCC_station.push_back(iph->stNum());
|
516 |
|
|
ltDCC_quality.push_back(iph->code());
|
517 |
|
|
ltDCC_bx.push_back(iph->bxNum());
|
518 |
|
|
ltDCC_phi.push_back(iph->phi());
|
519 |
|
|
ltDCC_phiB.push_back(iph->phiB());
|
520 |
|
|
ltDCC_is2nd.push_back(iph->Ts2Tag());
|
521 |
|
|
idtltDCC++;
|
522 |
|
|
}
|
523 |
guiducci |
1.31 |
//std::cout<<"Filled "<<idtltDCC<<" phi trigger segments from DCC data"<<std::endl;
|
524 |
|
|
return;
|
525 |
|
|
}
|
526 |
|
|
void TTreeGenerator::fill_simdcc_variables(edm::Handle<L1MuDTChambPhContainer> localTriggerDCC)
|
527 |
|
|
{
|
528 |
|
|
idtltSimDCC = 0;
|
529 |
|
|
std::vector<L1MuDTChambPhDigi>* phTrigs = localTriggerDCC->getContainer();
|
530 |
|
|
for(std::vector<L1MuDTChambPhDigi>::const_iterator iph = phTrigs->begin(); iph != phTrigs->end() ; ++iph){
|
531 |
|
|
if(idtltSimDCC >= dtltSimDCCSize_) break;
|
532 |
|
|
ltDCCemu_wheel.push_back(iph->whNum());
|
533 |
|
|
ltDCCemu_sector.push_back(iph->scNum() + 1); // DTTF[0-11] -> DT[1-12] Sector Numbering
|
534 |
|
|
ltDCCemu_station.push_back(iph->stNum());
|
535 |
|
|
ltDCCemu_quality.push_back(iph->code());
|
536 |
|
|
ltDCCemu_bx.push_back(iph->bxNum());
|
537 |
|
|
ltDCCemu_phi.push_back(iph->phi());
|
538 |
|
|
ltDCCemu_phiB.push_back(iph->phiB());
|
539 |
|
|
ltDCCemu_is2nd.push_back(iph->Ts2Tag());
|
540 |
|
|
idtltSimDCC++;
|
541 |
|
|
}
|
542 |
|
|
//std::cout<<"Filled "<<idtltSimDCC<<" phi trigger segments from emulator"<<std::endl;
|
543 |
gmasetti |
1.15 |
return;
|
544 |
|
|
}
|
545 |
|
|
|
546 |
|
|
void TTreeGenerator::fill_dccth_variables(edm::Handle<L1MuDTChambThContainer> localTriggerDCC_Th)
|
547 |
|
|
{
|
548 |
|
|
idtltDCC_th = 0;
|
549 |
|
|
std::vector<L1MuDTChambThDigi>* thTrigs = localTriggerDCC_Th->getContainer();
|
550 |
|
|
for(std::vector<L1MuDTChambThDigi>::const_iterator ith = thTrigs->begin(); ith != thTrigs->end() ; ++ith){
|
551 |
|
|
if(idtltDCC_th >= dtltDCCThSize_) break;
|
552 |
|
|
ltDCC_thWheel.push_back(ith->whNum());
|
553 |
|
|
ltDCC_thSector.push_back(ith->scNum() + 1); // DTTF[0-11] -> DT[1-12] Sector Numbering
|
554 |
|
|
ltDCC_thStation.push_back(ith->stNum());
|
555 |
|
|
ltDCC_thBx.push_back(ith->bxNum());
|
556 |
guiducci |
1.30 |
unsigned short int thcode=0;
|
557 |
|
|
for (int pos=0; pos<7; pos++)
|
558 |
|
|
if (ith->code(pos))
|
559 |
|
|
thcode=thcode | (0x1<<pos);
|
560 |
|
|
ltDCC_thHits.push_back(thcode);
|
561 |
gmasetti |
1.15 |
idtltDCC_th++;
|
562 |
|
|
}
|
563 |
pellicci |
1.1 |
return;
|
564 |
|
|
}
|
565 |
guiducci |
1.31 |
void TTreeGenerator::fill_simdccth_variables(edm::Handle<L1MuDTChambThContainer> localTriggerDCC_Th)
|
566 |
|
|
{
|
567 |
|
|
idtltSimDCC_th = 0;
|
568 |
|
|
std::vector<L1MuDTChambThDigi>* thTrigs = localTriggerDCC_Th->getContainer();
|
569 |
|
|
for(std::vector<L1MuDTChambThDigi>::const_iterator ith = thTrigs->begin(); ith != thTrigs->end() ; ++ith){
|
570 |
|
|
if(idtltSimDCC_th >= dtltSimDCCThSize_) break;
|
571 |
|
|
ltDCCemu_thWheel.push_back(ith->whNum());
|
572 |
|
|
ltDCCemu_thSector.push_back(ith->scNum() + 1); // DTTF[0-11] -> DT[1-12] Sector Numbering
|
573 |
|
|
ltDCCemu_thStation.push_back(ith->stNum());
|
574 |
|
|
ltDCCemu_thBx.push_back(ith->bxNum());
|
575 |
|
|
unsigned short int thcode=0;
|
576 |
|
|
for (int pos=0; pos<7; pos++)
|
577 |
|
|
if (ith->code(pos))
|
578 |
|
|
thcode=thcode | (0x1<<pos);
|
579 |
|
|
ltDCCemu_thHits.push_back(thcode);
|
580 |
|
|
idtltSimDCC_th++;
|
581 |
|
|
}
|
582 |
|
|
return;
|
583 |
|
|
}
|
584 |
pellicci |
1.1 |
|
585 |
|
|
void TTreeGenerator::fill_ddu_variables(edm::Handle<DTLocalTriggerCollection> localTriggerDDU)
|
586 |
|
|
{
|
587 |
|
|
idtltDDU = 0;
|
588 |
|
|
for (DTLocalTriggerCollection::DigiRangeIterator trigUnitIt = localTriggerDDU->begin();trigUnitIt!=localTriggerDDU->end();++trigUnitIt){
|
589 |
|
|
|
590 |
|
|
const DTChamberId& chambId = (*trigUnitIt).first;
|
591 |
|
|
const DTLocalTriggerCollection::Range& range = (*trigUnitIt).second;
|
592 |
|
|
|
593 |
|
|
for (DTLocalTriggerCollection::const_iterator trigIt = range.first; trigIt!=range.second;++trigIt){
|
594 |
|
|
|
595 |
|
|
if(idtltDDU >= dtltDDUSize_) return;
|
596 |
|
|
|
597 |
|
|
ltDDU_wheel.push_back(chambId.wheel());
|
598 |
|
|
ltDDU_sector.push_back(chambId.sector());
|
599 |
|
|
ltDDU_station.push_back(chambId.station());
|
600 |
|
|
ltDDU_bx.push_back(trigIt->bx());
|
601 |
|
|
ltDDU_phiQual.push_back(trigIt->quality());
|
602 |
|
|
ltDDU_thQual.push_back(trigIt->trTheta());
|
603 |
|
|
ltDDU_is2nd.push_back(trigIt->secondTrack());
|
604 |
|
|
|
605 |
|
|
idtltDDU++;
|
606 |
|
|
}
|
607 |
|
|
}
|
608 |
|
|
|
609 |
|
|
return;
|
610 |
|
|
}
|
611 |
|
|
|
612 |
|
|
void TTreeGenerator::fill_muons_variables(edm::Handle<reco::MuonCollection> MuList)
|
613 |
|
|
{
|
614 |
|
|
imuons = 0;
|
615 |
|
|
for (reco::MuonCollection::const_iterator nmuon = MuList->begin(); nmuon != MuList->end(); ++nmuon){
|
616 |
|
|
|
617 |
|
|
if(!(nmuon->isStandAloneMuon())) continue;
|
618 |
|
|
|
619 |
|
|
if(imuons >= STAMuSize_) break;
|
620 |
|
|
|
621 |
|
|
const reco::TrackRef mutrackref = nmuon->outerTrack();
|
622 |
|
|
|
623 |
|
|
STAMu_isMuGlobal.push_back(nmuon->isGlobalMuon());
|
624 |
pellicci |
1.10 |
STAMu_isMuTracker.push_back(nmuon->isTrackerMuon());
|
625 |
pellicci |
1.1 |
STAMu_numberOfChambers.push_back(nmuon->numberOfChambers());
|
626 |
|
|
STAMu_numberOfMatches.push_back(nmuon->numberOfMatches());
|
627 |
|
|
STAMu_numberOfHits.push_back(mutrackref->numberOfValidHits());
|
628 |
|
|
|
629 |
|
|
Mu_px_mu.push_back(nmuon->px());
|
630 |
|
|
Mu_py_mu.push_back(nmuon->py());
|
631 |
|
|
Mu_pz_mu.push_back(nmuon->pz());
|
632 |
|
|
Mu_phi_mu.push_back(nmuon->phi());
|
633 |
|
|
Mu_eta_mu.push_back(nmuon->eta());
|
634 |
|
|
|
635 |
|
|
STAMu_recHitsSize.push_back(mutrackref->recHitsSize());
|
636 |
|
|
STAMu_normchi2Mu.push_back(mutrackref->chi2()/mutrackref->ndof());
|
637 |
|
|
STAMu_chargeMu.push_back(mutrackref->charge());
|
638 |
pellicci |
1.9 |
STAMu_dxyMu.push_back(mutrackref->dxy(beamspot.position()));
|
639 |
|
|
STAMu_dzMu.push_back(mutrackref->dz(beamspot.position()));
|
640 |
pellicci |
1.1 |
|
641 |
pellicci |
1.8 |
int segmIndex = 0;
|
642 |
|
|
int segmWord = 0;
|
643 |
|
|
|
644 |
|
|
std::vector<int> segmIndex_container;
|
645 |
|
|
|
646 |
pellicci |
1.1 |
for (trackingRecHit_iterator recMu = mutrackref->recHitsBegin(); recMu!=mutrackref->recHitsEnd(); recMu++){
|
647 |
|
|
DetId detid = (*recMu)->geographicalId();
|
648 |
|
|
if(detid.subdetId() != MuonSubdetId::DT) continue;
|
649 |
|
|
|
650 |
|
|
DTChamberId recChamb(detid);
|
651 |
|
|
|
652 |
|
|
const short recWheel = recChamb.wheel();
|
653 |
|
|
const short recSector = recChamb.sector();
|
654 |
|
|
const short recStation = recChamb.station();
|
655 |
|
|
|
656 |
|
|
//loop over the saved segments and find the position of the rechits
|
657 |
|
|
//This is the quickest way to do this search: find the sector (highest number of
|
658 |
|
|
//combinations), loop over the find iterator, and search for wheel and stations
|
659 |
|
|
std::vector<short>::iterator sectorIt = std::find(segm4D_sector.begin(),segm4D_sector.end(),recSector);
|
660 |
|
|
while(sectorIt != segm4D_sector.end()){
|
661 |
|
|
|
662 |
pellicci |
1.8 |
segmIndex = (short) distance(segm4D_sector.begin(),sectorIt);
|
663 |
pellicci |
1.1 |
|
664 |
|
|
if(recWheel == segm4D_wheel.at(segmIndex) && recStation == segm4D_station.at(segmIndex))
|
665 |
pellicci |
1.8 |
if(find(segmIndex_container.begin(),segmIndex_container.end(),segmIndex) == segmIndex_container.end()){
|
666 |
|
|
segmIndex_container.push_back(segmIndex);
|
667 |
|
|
segmWord |= (1 << segmIndex);
|
668 |
|
|
}
|
669 |
pellicci |
1.1 |
sectorIt = std::find(sectorIt+1,segm4D_sector.end(),recSector);
|
670 |
|
|
}
|
671 |
|
|
}
|
672 |
|
|
|
673 |
pellicci |
1.8 |
STAMu_segmIndex.push_back(segmWord);
|
674 |
|
|
|
675 |
pellicci |
1.1 |
if(nmuon->isGlobalMuon()){
|
676 |
|
|
const reco::TrackRef glbmutrackref = nmuon->innerTrack();
|
677 |
|
|
GLBMu_normchi2Mu.push_back(glbmutrackref->chi2()/glbmutrackref->ndof());
|
678 |
pellicci |
1.9 |
GLBMu_dxyMu.push_back(glbmutrackref->dxy(beamspot.position()));
|
679 |
|
|
GLBMu_dzMu.push_back(glbmutrackref->dz(beamspot.position()));
|
680 |
pellicci |
1.1 |
|
681 |
battilan |
1.17 |
GLBMu_numberOfPixelHits.push_back(glbmutrackref->hitPattern().numberOfValidPixelHits());
|
682 |
|
|
GLBMu_numberOfTrackerHits.push_back(glbmutrackref->hitPattern().numberOfValidTrackerHits());
|
683 |
|
|
|
684 |
pellicci |
1.1 |
GLBMu_tkIsoR03.push_back(nmuon->isolationR03().sumPt);
|
685 |
|
|
GLBMu_ntkIsoR03.push_back(nmuon->isolationR03().nTracks);
|
686 |
|
|
GLBMu_emIsoR03.push_back(nmuon->isolationR03().emEt);
|
687 |
|
|
GLBMu_hadIsoR03.push_back(nmuon->isolationR03().hadEt);
|
688 |
|
|
}
|
689 |
|
|
else{
|
690 |
|
|
GLBMu_normchi2Mu.push_back(-999.);
|
691 |
|
|
GLBMu_dxyMu.push_back(-999.);
|
692 |
|
|
GLBMu_dzMu.push_back(-999.);
|
693 |
|
|
|
694 |
battilan |
1.17 |
GLBMu_numberOfPixelHits.push_back(-999);
|
695 |
|
|
GLBMu_numberOfTrackerHits.push_back(-999);
|
696 |
|
|
|
697 |
pellicci |
1.1 |
GLBMu_tkIsoR03.push_back(-999.);
|
698 |
|
|
GLBMu_ntkIsoR03.push_back(-999.);
|
699 |
|
|
GLBMu_emIsoR03.push_back(-999.);
|
700 |
|
|
GLBMu_hadIsoR03.push_back(-999.);
|
701 |
|
|
}
|
702 |
|
|
|
703 |
|
|
if(nmuon->isCaloCompatibilityValid()) STAMu_caloCompatibility.push_back(nmuon->caloCompatibility());
|
704 |
|
|
else STAMu_caloCompatibility.push_back(-999.);
|
705 |
|
|
|
706 |
|
|
//extrapolate the muon to the MB2
|
707 |
|
|
TrajectoryStateOnSurface tsos;
|
708 |
|
|
tsos = cylExtrapTrkSam(mutrackref,500.); // track at MB2 radius - extrapolation
|
709 |
|
|
|
710 |
|
|
if (tsos.isValid()){
|
711 |
|
|
static const float pig = acos(-1.);
|
712 |
|
|
|
713 |
|
|
const double xx = tsos.globalPosition().x();
|
714 |
|
|
const double yy = tsos.globalPosition().y();
|
715 |
|
|
const double zz = tsos.globalPosition().z();
|
716 |
|
|
|
717 |
|
|
const double rr = sqrt(xx*xx + yy*yy);
|
718 |
|
|
const double cosphi = xx/rr;
|
719 |
|
|
const double abspseta = -log(tan(atan(fabs(rr/zz))/2.));
|
720 |
|
|
|
721 |
|
|
STAMu_z_mb2.push_back(zz);
|
722 |
|
|
|
723 |
|
|
if (yy>=0) STAMu_phi_mb2.push_back(acos(cosphi));
|
724 |
|
|
else STAMu_phi_mb2.push_back(2*pig-acos(cosphi));
|
725 |
|
|
|
726 |
|
|
|
727 |
|
|
if (zz>=0) STAMu_pseta_mb2.push_back(abspseta);
|
728 |
|
|
else STAMu_pseta_mb2.push_back(-abspseta);
|
729 |
|
|
}
|
730 |
|
|
else{
|
731 |
|
|
STAMu_z_mb2.push_back(-999.);
|
732 |
|
|
STAMu_phi_mb2.push_back(-999.);
|
733 |
|
|
STAMu_pseta_mb2.push_back(-999.);
|
734 |
|
|
}
|
735 |
|
|
|
736 |
|
|
imuons++;
|
737 |
|
|
}
|
738 |
|
|
|
739 |
|
|
return;
|
740 |
|
|
}
|
741 |
|
|
|
742 |
|
|
void TTreeGenerator::fill_gmt_variables(edm::Handle<L1MuGMTReadoutCollection> gmtrc)
|
743 |
|
|
{
|
744 |
|
|
igmtdt = 0;
|
745 |
|
|
igmtcands = 0;
|
746 |
|
|
|
747 |
|
|
std::vector<L1MuGMTReadoutRecord> gmt_records = gmtrc->getRecords();
|
748 |
|
|
for(std::vector<L1MuGMTReadoutRecord>::const_iterator igmtrr=gmt_records.begin(); igmtrr!=gmt_records.end(); igmtrr++) {
|
749 |
|
|
|
750 |
|
|
//loop over the different subdetector cands
|
751 |
|
|
for(int i=0;i<4;i++){
|
752 |
|
|
|
753 |
|
|
std::vector<L1MuRegionalCand> cands = getBXCands(&(*igmtrr),i);
|
754 |
|
|
|
755 |
|
|
for(std::vector<L1MuRegionalCand>::const_iterator candIt = cands.begin(); candIt!=cands.end(); ++candIt){
|
756 |
|
|
|
757 |
|
|
if(igmtdt >= gmtSize_) break;
|
758 |
|
|
|
759 |
|
|
if(!candIt->empty()){
|
760 |
|
|
gmt_bx.push_back((*candIt).bx());
|
761 |
|
|
gmt_phi.push_back((*candIt).phiValue());
|
762 |
|
|
gmt_eta.push_back((*candIt).etaValue());
|
763 |
|
|
gmt_pt.push_back((*candIt).ptValue());
|
764 |
|
|
gmt_qual.push_back((*candIt).quality());
|
765 |
|
|
gmt_detector.push_back(i);
|
766 |
|
|
|
767 |
|
|
igmtdt++;
|
768 |
|
|
}
|
769 |
|
|
}
|
770 |
|
|
}
|
771 |
|
|
|
772 |
|
|
std::vector<L1MuGMTExtendedCand> candsOut = igmtrr->getGMTCands();
|
773 |
|
|
for(std::vector<L1MuGMTExtendedCand>::const_iterator candOutIt = candsOut.begin(); candOutIt!=candsOut.end(); ++candOutIt){
|
774 |
|
|
|
775 |
|
|
if(igmtcands >= gmtSize_) break;
|
776 |
|
|
|
777 |
|
|
if(!candOutIt->empty()){
|
778 |
|
|
gmt_cands_fwd.push_back((*candOutIt).isFwd());
|
779 |
|
|
gmt_cands_isRpc.push_back((*candOutIt).isRPC());
|
780 |
|
|
gmt_cands_bx.push_back((*candOutIt).bx());
|
781 |
|
|
gmt_cands_phi.push_back((*candOutIt).phiValue());
|
782 |
|
|
gmt_cands_eta.push_back((*candOutIt).etaValue());
|
783 |
|
|
gmt_cands_pt.push_back((*candOutIt).ptValue());
|
784 |
|
|
gmt_cands_qual.push_back((*candOutIt).quality());
|
785 |
pellicci |
1.6 |
gmt_cands_ismatched.push_back((*candOutIt).isMatchedCand());
|
786 |
pellicci |
1.1 |
|
787 |
|
|
igmtcands++;
|
788 |
|
|
}
|
789 |
|
|
}
|
790 |
|
|
|
791 |
|
|
}
|
792 |
|
|
|
793 |
|
|
return;
|
794 |
|
|
}
|
795 |
|
|
|
796 |
battilan |
1.17 |
void TTreeGenerator::fill_gt_variables(edm::Handle<L1GlobalTriggerReadoutRecord> gtrr, const L1GtTriggerMenu* menu) // CB FIXME speedup
|
797 |
|
|
{
|
798 |
|
|
igtalgo = 0;
|
799 |
|
|
igttt = 0;
|
800 |
|
|
|
801 |
|
|
const AlgorithmMap algoMap = menu->gtAlgorithmMap();
|
802 |
|
|
const AlgorithmMap ttMap = menu->gtTechnicalTriggerMap();
|
803 |
|
|
|
804 |
|
|
for(int ibx=0; ibx<5; ibx++) {
|
805 |
|
|
DecisionWord gtDecisionWord = gtrr->decisionWord(ibx-2);
|
806 |
|
|
|
807 |
|
|
if (!gtDecisionWord.empty()) {
|
808 |
|
|
|
809 |
|
|
CItAlgo algoMapIt = algoMap.begin();
|
810 |
|
|
CItAlgo algoMapEnd = algoMap.end();
|
811 |
|
|
|
812 |
|
|
for(; algoMapIt!=algoMapEnd; ++algoMapIt) {
|
813 |
|
|
if( menu->gtAlgorithmResult((*algoMapIt).first, gtDecisionWord) ) {
|
814 |
|
|
// gt_algo_bit.push_back(TString((*algoMapIt).first));
|
815 |
|
|
gt_algo_bit.push_back((algoMapIt->second).algoBitNumber());
|
816 |
|
|
gt_algo_bx.push_back(ibx-2);
|
817 |
|
|
igtalgo++;
|
818 |
|
|
}
|
819 |
|
|
}
|
820 |
|
|
}
|
821 |
|
|
|
822 |
|
|
TechnicalTriggerWord gtTTWord = gtrr->technicalTriggerWord(ibx-2);
|
823 |
|
|
|
824 |
|
|
if (!gtTTWord.empty()) {
|
825 |
|
|
|
826 |
|
|
CItAlgo ttMapIt = ttMap.begin();
|
827 |
|
|
CItAlgo ttMapEnd = ttMap.end();
|
828 |
|
|
|
829 |
|
|
for(; ttMapIt!=ttMapEnd; ++ttMapIt) {
|
830 |
|
|
|
831 |
|
|
int bitNumber = (ttMapIt->second).algoBitNumber();
|
832 |
|
|
if (gtTTWord.at(bitNumber)) {
|
833 |
|
|
// gt_tt_bit.push_back(TString(ttMapIt->first));
|
834 |
|
|
gt_tt_bit.push_back((ttMapIt->second).algoBitNumber());
|
835 |
|
|
gt_tt_bx.push_back(ibx-2);
|
836 |
|
|
igttt++;
|
837 |
|
|
}
|
838 |
|
|
|
839 |
|
|
}
|
840 |
|
|
}
|
841 |
|
|
|
842 |
|
|
}
|
843 |
|
|
|
844 |
|
|
return;
|
845 |
|
|
}
|
846 |
|
|
|
847 |
|
|
void TTreeGenerator::fill_hlt_variables(const edm::Event &e, edm::Handle<edm::TriggerResults> hltresults)
|
848 |
|
|
{
|
849 |
|
|
ihlt = 0;
|
850 |
|
|
const edm::TriggerNames TrigNames_ = e.triggerNames(*hltresults);
|
851 |
|
|
const int ntrigs = hltresults->size();
|
852 |
|
|
|
853 |
|
|
for (int itr=0; itr<ntrigs; itr++){
|
854 |
|
|
TString trigName=TrigNames_.triggerName(itr);
|
855 |
|
|
if (hltresults->accept(itr)) {
|
856 |
|
|
hlt_path.push_back(trigName);
|
857 |
|
|
ihlt++;
|
858 |
|
|
}
|
859 |
|
|
}
|
860 |
|
|
|
861 |
|
|
return;
|
862 |
|
|
}
|
863 |
|
|
|
864 |
guiducci |
1.32 |
void TTreeGenerator::fill_rpc_variables(const edm::Event &e, edm::Handle<RPCRecHitCollection> rpcrechits){
|
865 |
|
|
RPCRecHitCollection::const_iterator recHit;
|
866 |
|
|
irpcrechits=0;
|
867 |
|
|
for(recHit = rpcrechits->begin(); recHit != rpcrechits->end(); recHit++){
|
868 |
|
|
int cls = recHit->clusterSize();
|
869 |
|
|
int firststrip = recHit->firstClusterStrip();
|
870 |
|
|
int bx = recHit->BunchX();
|
871 |
|
|
RPCDetId rpcId = recHit->rpcId();
|
872 |
guiducci |
1.33 |
int region = rpcId.region();
|
873 |
guiducci |
1.32 |
int stat = rpcId.station();
|
874 |
|
|
int sect = rpcId.sector();
|
875 |
|
|
int layer = rpcId.layer();
|
876 |
|
|
int subsector = rpcId.subsector();
|
877 |
|
|
int roll = rpcId.roll();
|
878 |
|
|
int ring = rpcId.ring();
|
879 |
guiducci |
1.33 |
rpc_region.push_back(region);
|
880 |
guiducci |
1.32 |
rpc_clusterSize.push_back(cls);
|
881 |
|
|
rpc_strip.push_back(firststrip);
|
882 |
|
|
rpc_bx.push_back(bx);
|
883 |
|
|
rpc_station.push_back(stat);
|
884 |
|
|
rpc_sector.push_back(sect);
|
885 |
|
|
rpc_layer.push_back(layer);
|
886 |
|
|
rpc_subsector.push_back(subsector);
|
887 |
|
|
rpc_roll.push_back(roll);
|
888 |
|
|
rpc_ring.push_back(ring);
|
889 |
|
|
irpcrechits++;
|
890 |
|
|
}
|
891 |
|
|
|
892 |
|
|
|
893 |
|
|
return;
|
894 |
|
|
}
|
895 |
|
|
|
896 |
|
|
|
897 |
|
|
|
898 |
|
|
|
899 |
|
|
|
900 |
pellicci |
1.1 |
std::vector<L1MuRegionalCand> TTreeGenerator::getBXCands(const L1MuGMTReadoutRecord* igmtrr, const int DetectorType) const
|
901 |
|
|
{
|
902 |
|
|
if(DetectorType == 0) return igmtrr->getDTBXCands();
|
903 |
|
|
else if(DetectorType == 1) return igmtrr->getCSCCands();
|
904 |
|
|
else if(DetectorType == 2) return igmtrr->getBrlRPCCands();
|
905 |
|
|
else if(DetectorType == 3) return igmtrr->getFwdRPCCands();
|
906 |
|
|
|
907 |
|
|
return igmtrr->getDTBXCands();
|
908 |
|
|
}
|
909 |
|
|
|
910 |
|
|
|
911 |
|
|
void TTreeGenerator::beginJob()
|
912 |
|
|
{
|
913 |
battilan |
1.14 |
outFile = new TFile(outFile_.c_str(), "RECREATE", "");
|
914 |
pellicci |
1.1 |
outFile->cd();
|
915 |
|
|
|
916 |
|
|
tree_ = new TTree ("DTTree", "CMSSW DT tree");
|
917 |
|
|
|
918 |
|
|
//Event info
|
919 |
|
|
tree_->Branch("runnumber",&runnumber,"runnumber/I");
|
920 |
|
|
tree_->Branch("lumiblock",&lumiblock,"lumiblock/I");
|
921 |
|
|
tree_->Branch("eventNumber",&eventNumber,"eventNumber/I");
|
922 |
|
|
tree_->Branch("timestamp",×tamp,"timestamp/F");
|
923 |
|
|
tree_->Branch("bunchXing",&bunchXing,"bunchXing/I");
|
924 |
|
|
tree_->Branch("orbitNum",&orbitNum,"orbitNum/I");
|
925 |
|
|
|
926 |
|
|
//Primary vertex
|
927 |
|
|
tree_->Branch("PV_x",&PV_x,"PV_x/F");
|
928 |
|
|
tree_->Branch("PV_y",&PV_y,"PV_y/F");
|
929 |
|
|
tree_->Branch("PV_z",&PV_z,"PV_z/F");
|
930 |
|
|
|
931 |
|
|
tree_->Branch("PV_xxE",&PV_xxE,"PV_xxE/F");
|
932 |
|
|
tree_->Branch("PV_yyE",&PV_yyE,"PV_yyE/F");
|
933 |
|
|
tree_->Branch("PV_zzE",&PV_zzE,"PV_zzE/F");
|
934 |
|
|
tree_->Branch("PV_xyE",&PV_xyE,"PV_xyE/F");
|
935 |
|
|
tree_->Branch("PV_xzE",&PV_xzE,"PV_xzE/F");
|
936 |
|
|
tree_->Branch("PV_yzE",&PV_yzE,"PV_yzE/F");
|
937 |
|
|
|
938 |
|
|
tree_->Branch("PV_normchi2",&PV_normchi2,"PV_normch2/F");
|
939 |
pellicci |
1.29 |
tree_->Branch("PV_Nvtx",&PV_Nvtx,"PV_Nvtx/F");
|
940 |
pellicci |
1.1 |
|
941 |
pellicci |
1.26 |
//luminosity
|
942 |
|
|
tree_->Branch("lumiperblock",&lumiperblock,"lumiperblock/F");
|
943 |
pellicci |
1.28 |
tree_->Branch("beam1Intensity",&beam1Intensity,"beam1Intensity/F");
|
944 |
|
|
tree_->Branch("beam2Intensity",&beam2Intensity,"beam2Intensity/F");
|
945 |
pellicci |
1.26 |
|
946 |
pellicci |
1.1 |
//HLT
|
947 |
battilan |
1.17 |
tree_->Branch("hlt_path",&hlt_path,32000,-1);
|
948 |
pellicci |
1.1 |
|
949 |
|
|
//digi variables
|
950 |
|
|
tree_->Branch("digi_wheel",&digi_wheel);
|
951 |
|
|
tree_->Branch("digi_sector",&digi_sector);
|
952 |
|
|
tree_->Branch("digi_station",&digi_station);
|
953 |
|
|
tree_->Branch("digi_sl",&digi_sl);
|
954 |
|
|
tree_->Branch("digi_layer",&digi_layer);
|
955 |
|
|
tree_->Branch("digi_wire",&digi_wire);
|
956 |
|
|
tree_->Branch("digi_time",&digi_time);
|
957 |
|
|
|
958 |
|
|
//DT segment variables
|
959 |
|
|
tree_->Branch("dtsegm4D_wheel",&segm4D_wheel);
|
960 |
|
|
tree_->Branch("dtsegm4D_sector",&segm4D_sector);
|
961 |
|
|
tree_->Branch("dtsegm4D_station",&segm4D_station);
|
962 |
|
|
|
963 |
|
|
tree_->Branch("dtsegm4D_hasPhi",&segm4D_hasPhi);
|
964 |
|
|
tree_->Branch("dtsegm4D_hasZed",&segm4D_hasZed);
|
965 |
battilan |
1.11 |
tree_->Branch("dtsegm4D_x_pos_loc",&segm4D_x_pos_loc);
|
966 |
|
|
tree_->Branch("dtsegm4D_y_pos_loc",&segm4D_y_pos_loc);
|
967 |
|
|
tree_->Branch("dtsegm4D_z_pos_loc",&segm4D_z_pos_loc);
|
968 |
|
|
tree_->Branch("dtsegm4D_x_dir_loc",&segm4D_x_dir_loc);
|
969 |
|
|
tree_->Branch("dtsegm4D_y_dir_loc",&segm4D_y_dir_loc);
|
970 |
|
|
tree_->Branch("dtsegm4D_z_dir_loc",&segm4D_z_dir_loc);
|
971 |
pellicci |
1.8 |
tree_->Branch("dtsegm4D_cosx",&segm4D_cosx);
|
972 |
|
|
tree_->Branch("dtsegm4D_cosy",&segm4D_cosy);
|
973 |
|
|
tree_->Branch("dtsegm4D_cosz",&segm4D_cosz);
|
974 |
pellicci |
1.1 |
tree_->Branch("dtsegm4D_phi",&segm4D_phi);
|
975 |
|
|
tree_->Branch("dtsegm4D_theta",&segm4D_theta);
|
976 |
|
|
tree_->Branch("dtsegm4D_eta",&segm4D_eta);
|
977 |
|
|
tree_->Branch("dtsegm4D_t0",&segm4D_t0);
|
978 |
dtdqm |
1.16 |
tree_->Branch("dtsegm4D_vdrift",&segm4D_vdrift);
|
979 |
pellicci |
1.1 |
tree_->Branch("dtsegm4D_phinormchisq",&segm4D_phinormchi2);
|
980 |
|
|
tree_->Branch("dtsegm4D_phinhits",&segm4D_phinhits);
|
981 |
|
|
tree_->Branch("dtsegm4D_znormchisq",&segm4D_znormchi2);
|
982 |
|
|
tree_->Branch("dtsegm4D_znhits",&segm4D_znhits);
|
983 |
|
|
|
984 |
|
|
//rechits info
|
985 |
|
|
tree_->Branch("dtsegm4D_phi_hitsPos",&segm4D_phiHits_Pos,2048000,0);
|
986 |
battilan |
1.24 |
tree_->Branch("dtsegm4D_phi_hitsPosCh",&segm4D_phiHits_PosCh,2048000,0);
|
987 |
pellicci |
1.1 |
tree_->Branch("dtsegm4D_phi_hitsPosErr",&segm4D_phiHits_PosErr,2048000,0);
|
988 |
|
|
tree_->Branch("dtsegm4D_phi_hitsSide",&segm4D_phiHits_Side,2048000,0);
|
989 |
pellicci |
1.23 |
tree_->Branch("dtsegm4D_phi_hitsWire",&segm4D_phiHits_Wire,2048000,0);
|
990 |
|
|
tree_->Branch("dtsegm4D_phi_hitsLayer",&segm4D_phiHits_Layer,2048000,0);
|
991 |
pellicci |
1.1 |
|
992 |
|
|
tree_->Branch("dtsegm4D_z_hitsPos",&segm4D_zHits_Pos,2048000,0);
|
993 |
battilan |
1.24 |
tree_->Branch("dtsegm4D_z_hitsPosCh",&segm4D_zHits_PosCh,2048000,0);
|
994 |
pellicci |
1.1 |
tree_->Branch("dtsegm4D_z_hitsPosErr",&segm4D_zHits_PosErr,2048000,0);
|
995 |
|
|
tree_->Branch("dtsegm4D_z_hitsSide",&segm4D_zHits_Side,2048000,0);
|
996 |
pellicci |
1.23 |
tree_->Branch("dtsegm4D_z_hitsWire",&segm4D_zHits_Wire,2048000,0);
|
997 |
|
|
tree_->Branch("dtsegm4D_z_hitsLayer",&segm4D_zHits_Layer,2048000,0);
|
998 |
pellicci |
1.1 |
|
999 |
|
|
//CSC segment variables
|
1000 |
|
|
tree_->Branch("cscsegm_ring",&cscsegm_ring);
|
1001 |
|
|
tree_->Branch("cscsegm_chamber",&cscsegm_chamber);
|
1002 |
|
|
tree_->Branch("cscsegm_station",&cscsegm_station);
|
1003 |
pellicci |
1.8 |
tree_->Branch("cscsegm_cosx",&cscsegm_cosx);
|
1004 |
|
|
tree_->Branch("cscsegm_cosy",&cscsegm_cosy);
|
1005 |
|
|
tree_->Branch("cscsegm_cosz",&cscsegm_cosz);
|
1006 |
pellicci |
1.1 |
tree_->Branch("cscsegm_phi",&cscsegm_phi);
|
1007 |
|
|
tree_->Branch("cscsegm_eta",&cscsegm_eta);
|
1008 |
|
|
tree_->Branch("cscsegm_normchisq",&cscsegm_normchi2);
|
1009 |
|
|
tree_->Branch("cscsegm_nRecHits",&cscsegm_nRecHits);
|
1010 |
|
|
|
1011 |
|
|
//DCC variables
|
1012 |
|
|
tree_->Branch("ltDCC_wheel",<DCC_wheel);
|
1013 |
|
|
tree_->Branch("ltDCC_sector",<DCC_sector);
|
1014 |
|
|
tree_->Branch("ltDCC_station",<DCC_station);
|
1015 |
|
|
tree_->Branch("ltDCC_quality",<DCC_quality);
|
1016 |
|
|
tree_->Branch("ltDCC_bx",<DCC_bx);
|
1017 |
|
|
tree_->Branch("ltDCC_phi",<DCC_phi);
|
1018 |
|
|
tree_->Branch("ltDCC_phiB",<DCC_phiB);
|
1019 |
|
|
tree_->Branch("ltDCC_is2nd",<DCC_is2nd);
|
1020 |
|
|
|
1021 |
gmasetti |
1.15 |
tree_->Branch("ltDCC_thWheel",<DCC_thWheel);
|
1022 |
|
|
tree_->Branch("ltDCC_thSector",<DCC_thSector);
|
1023 |
|
|
tree_->Branch("ltDCC_thStation",<DCC_thStation);
|
1024 |
|
|
tree_->Branch("ltDCC_thBx",<DCC_thBx);
|
1025 |
guiducci |
1.30 |
tree_->Branch("ltDCC_thHits",<DCC_thHits);
|
1026 |
gmasetti |
1.15 |
|
1027 |
guiducci |
1.31 |
tree_->Branch("ltDCCemu_wheel",<DCCemu_wheel);
|
1028 |
|
|
tree_->Branch("ltDCCemu_sector",<DCCemu_sector);
|
1029 |
|
|
tree_->Branch("ltDCCemu_station",<DCCemu_station);
|
1030 |
|
|
tree_->Branch("ltDCCemu_quality",<DCCemu_quality);
|
1031 |
|
|
tree_->Branch("ltDCCemu_bx",<DCCemu_bx);
|
1032 |
|
|
tree_->Branch("ltDCCemu_phi",<DCCemu_phi);
|
1033 |
|
|
tree_->Branch("ltDCCemu_phiB",<DCCemu_phiB);
|
1034 |
|
|
tree_->Branch("ltDCCemu_is2nd",<DCCemu_is2nd);
|
1035 |
|
|
|
1036 |
|
|
tree_->Branch("ltDCCemu_thWheel",<DCCemu_thWheel);
|
1037 |
|
|
tree_->Branch("ltDCCemu_thSector",<DCCemu_thSector);
|
1038 |
|
|
tree_->Branch("ltDCCemu_thStation",<DCCemu_thStation);
|
1039 |
|
|
tree_->Branch("ltDCCemu_thBx",<DCCemu_thBx);
|
1040 |
|
|
tree_->Branch("ltDCCemu_thHits",<DCCemu_thHits);
|
1041 |
|
|
|
1042 |
pellicci |
1.1 |
//DDU variables
|
1043 |
|
|
tree_->Branch("ltDDU_wheel",<DDU_wheel);
|
1044 |
|
|
tree_->Branch("ltDDU_sector",<DDU_sector);
|
1045 |
|
|
tree_->Branch("ltDDU_station",<DDU_station);
|
1046 |
|
|
tree_->Branch("ltDDU_bx",<DDU_bx);
|
1047 |
|
|
tree_->Branch("ltDDU_phiQual",<DDU_phiQual);
|
1048 |
|
|
tree_->Branch("ltDDU_thQual",<DDU_thQual);
|
1049 |
|
|
tree_->Branch("ltDDU_is2nd",<DDU_is2nd);
|
1050 |
|
|
|
1051 |
|
|
//muon variables
|
1052 |
|
|
tree_->Branch("Mu_isMuGlobal",&STAMu_isMuGlobal);
|
1053 |
pellicci |
1.10 |
tree_->Branch("Mu_isMuTracker",&STAMu_isMuTracker);
|
1054 |
pellicci |
1.1 |
tree_->Branch("Mu_numberOfChambers_sta",&STAMu_numberOfChambers);
|
1055 |
|
|
tree_->Branch("Mu_numberOfMatches_sta",&STAMu_numberOfMatches);
|
1056 |
|
|
tree_->Branch("Mu_numberOfHits_sta",&STAMu_numberOfHits);
|
1057 |
|
|
tree_->Branch("Mu_segmentIndex_sta",&STAMu_segmIndex);
|
1058 |
|
|
|
1059 |
|
|
tree_->Branch("Mu_px",&Mu_px_mu);
|
1060 |
|
|
tree_->Branch("Mu_py",&Mu_py_mu);
|
1061 |
|
|
tree_->Branch("Mu_pz",&Mu_pz_mu);
|
1062 |
|
|
tree_->Branch("Mu_phi",&Mu_phi_mu);
|
1063 |
|
|
tree_->Branch("Mu_eta",&Mu_eta_mu);
|
1064 |
|
|
tree_->Branch("Mu_recHitsSize",&STAMu_recHitsSize);
|
1065 |
|
|
tree_->Branch("Mu_normchi2_sta",&STAMu_normchi2Mu);
|
1066 |
|
|
tree_->Branch("Mu_charge",&STAMu_chargeMu);
|
1067 |
|
|
tree_->Branch("Mu_dxy_sta",&STAMu_dxyMu);
|
1068 |
|
|
tree_->Branch("Mu_dz_sta",&STAMu_dzMu);
|
1069 |
|
|
|
1070 |
|
|
tree_->Branch("Mu_normchi2_glb",&GLBMu_normchi2Mu);
|
1071 |
|
|
tree_->Branch("Mu_dxy_glb",&GLBMu_dxyMu);
|
1072 |
|
|
tree_->Branch("Mu_dz_glb",&GLBMu_dzMu);
|
1073 |
|
|
|
1074 |
battilan |
1.17 |
tree_->Branch("Mu_numberOfPixelHits_glb",&GLBMu_numberOfPixelHits);
|
1075 |
|
|
tree_->Branch("Mu_numberOfTrackerHits_glb",&GLBMu_numberOfTrackerHits);
|
1076 |
|
|
|
1077 |
pellicci |
1.1 |
tree_->Branch("Mu_tkIsoR03_glb",&GLBMu_tkIsoR03);
|
1078 |
|
|
tree_->Branch("Mu_ntkIsoR03_glb",&GLBMu_ntkIsoR03);
|
1079 |
|
|
tree_->Branch("Mu_emIsoR03_glb",&GLBMu_emIsoR03);
|
1080 |
|
|
tree_->Branch("Mu_hadIsoR03_glb",&GLBMu_hadIsoR03);
|
1081 |
|
|
|
1082 |
|
|
tree_->Branch("STAMu_caloCompatibility",&STAMu_caloCompatibility);
|
1083 |
|
|
|
1084 |
|
|
tree_->Branch("Mu_z_mb2_mu",&STAMu_z_mb2);
|
1085 |
|
|
tree_->Branch("Mu_phi_mb2_mu",&STAMu_phi_mb2);
|
1086 |
|
|
tree_->Branch("Mu_pseta_mb2_mu",&STAMu_pseta_mb2);
|
1087 |
|
|
|
1088 |
|
|
//GMT
|
1089 |
|
|
tree_->Branch("gmt_bx",&gmt_bx);
|
1090 |
|
|
tree_->Branch("gmt_phi",&gmt_phi);
|
1091 |
|
|
tree_->Branch("gmt_eta",&gmt_eta);
|
1092 |
|
|
tree_->Branch("gmt_pt",&gmt_pt);
|
1093 |
|
|
tree_->Branch("gmt_qual",&gmt_qual);
|
1094 |
|
|
tree_->Branch("gmt_detector",&gmt_detector);
|
1095 |
|
|
|
1096 |
|
|
tree_->Branch("gmt_cands_fwd",&gmt_cands_fwd);
|
1097 |
|
|
tree_->Branch("gmt_cands_isRpc",&gmt_cands_isRpc);
|
1098 |
|
|
tree_->Branch("gmt_cands_bx",&gmt_cands_bx);
|
1099 |
|
|
tree_->Branch("gmt_cands_phi",&gmt_cands_phi);
|
1100 |
|
|
tree_->Branch("gmt_cands_eta",&gmt_cands_eta);
|
1101 |
|
|
tree_->Branch("gmt_cands_pt",&gmt_cands_pt);
|
1102 |
|
|
tree_->Branch("gmt_cands_qual",&gmt_cands_qual);
|
1103 |
pellicci |
1.6 |
tree_->Branch("gmt_cands_ismatched",&gmt_cands_ismatched);
|
1104 |
pellicci |
1.1 |
|
1105 |
battilan |
1.17 |
//GT
|
1106 |
|
|
tree_->Branch("gt_algo_bit",>_algo_bit);
|
1107 |
|
|
tree_->Branch("gt_algo_bx",>_algo_bx);
|
1108 |
|
|
tree_->Branch("gt_tt_bit",>_tt_bit);
|
1109 |
|
|
tree_->Branch("gt_tt_bx",>_tt_bx);
|
1110 |
|
|
|
1111 |
guiducci |
1.32 |
//RPC
|
1112 |
|
|
|
1113 |
|
|
|
1114 |
|
|
|
1115 |
|
|
|
1116 |
|
|
|
1117 |
|
|
|
1118 |
|
|
|
1119 |
|
|
|
1120 |
|
|
|
1121 |
|
|
|
1122 |
guiducci |
1.33 |
tree_->Branch( "rpc_region",&rpc_region);
|
1123 |
guiducci |
1.32 |
tree_->Branch( "rpc_clusterSize",&rpc_clusterSize);
|
1124 |
|
|
tree_->Branch( "rpc_strip",&rpc_strip);
|
1125 |
|
|
tree_->Branch( "rpc_bx",&rpc_bx);
|
1126 |
|
|
tree_->Branch( "rpc_station",&rpc_station);
|
1127 |
|
|
tree_->Branch( "rpc_sector",&rpc_sector);
|
1128 |
|
|
tree_->Branch( "rpc_layer",&rpc_layer);
|
1129 |
|
|
tree_->Branch( "rpc_subsector",&rpc_subsector);
|
1130 |
|
|
tree_->Branch( "rpc_roll",&rpc_roll);
|
1131 |
|
|
tree_->Branch( "rpc_ring",&rpc_ring);
|
1132 |
pellicci |
1.1 |
//counters
|
1133 |
|
|
tree_->Branch("Ndigis",&idigis,"Ndigis/S");
|
1134 |
|
|
tree_->Branch("Ndtsegments",&idtsegments,"Ndtsegments/S");
|
1135 |
|
|
tree_->Branch("Ncscsegments",&icscsegments,"Ncscsegments/S");
|
1136 |
gmasetti |
1.15 |
tree_->Branch("NdtltDCC_th",&idtltDCC_th,"NdtltDCC_th/S");
|
1137 |
pellicci |
1.1 |
tree_->Branch("NdtltDCC",&idtltDCC,"NdtltDCC/S");
|
1138 |
guiducci |
1.31 |
tree_->Branch("NdtltSimDCC_th",&idtltSimDCC_th,"NdtltSimDCC_th/S");
|
1139 |
|
|
tree_->Branch("NdtltSimDCC",&idtltSimDCC,"NdtltSimDCC/S");
|
1140 |
battilan |
1.11 |
tree_->Branch("NdtltDDU",&idtltDDU,"NdtltDDU/S");
|
1141 |
pellicci |
1.1 |
tree_->Branch("Nmuons",&imuons,"Nmuons/S");
|
1142 |
pellicci |
1.6 |
tree_->Branch("Ngmt",&igmtdt,"Ngmt/S");
|
1143 |
pellicci |
1.1 |
tree_->Branch("Ngmtcands",&igmtcands,"Ngmtcands/S");
|
1144 |
battilan |
1.18 |
tree_->Branch("Ngtalgo",&igtalgo,"Ngtalgo/S");
|
1145 |
|
|
tree_->Branch("Ngttechtrig",&igttt,"Ngttt/S");
|
1146 |
|
|
tree_->Branch("Nhlt",&ihlt,"Nhlt/S");
|
1147 |
guiducci |
1.32 |
tree_->Branch("NrpcRecHits",&irpcrechits,"NrpcRecHits/S");
|
1148 |
pellicci |
1.1 |
|
1149 |
|
|
return;
|
1150 |
|
|
}
|
1151 |
|
|
|
1152 |
|
|
void TTreeGenerator::endJob()
|
1153 |
|
|
{
|
1154 |
|
|
outFile->cd();
|
1155 |
|
|
tree_->Write();
|
1156 |
|
|
outFile->Close();
|
1157 |
|
|
|
1158 |
|
|
return;
|
1159 |
|
|
}
|
1160 |
|
|
|
1161 |
|
|
inline void TTreeGenerator::clear_Arrays()
|
1162 |
|
|
{
|
1163 |
|
|
//digi variables
|
1164 |
|
|
digi_wheel.clear();
|
1165 |
|
|
digi_sector.clear();
|
1166 |
|
|
digi_station.clear();
|
1167 |
|
|
digi_sl.clear();
|
1168 |
|
|
digi_layer.clear();
|
1169 |
|
|
digi_wire.clear();
|
1170 |
|
|
digi_time.clear();
|
1171 |
|
|
|
1172 |
|
|
//DT segment variables
|
1173 |
|
|
segm4D_wheel.clear();
|
1174 |
|
|
segm4D_sector.clear();
|
1175 |
|
|
segm4D_station.clear();
|
1176 |
|
|
segm4D_hasPhi.clear();
|
1177 |
|
|
segm4D_hasZed.clear();
|
1178 |
battilan |
1.11 |
segm4D_x_pos_loc.clear();
|
1179 |
|
|
segm4D_y_pos_loc.clear();
|
1180 |
|
|
segm4D_z_pos_loc.clear();
|
1181 |
|
|
segm4D_x_dir_loc.clear();
|
1182 |
|
|
segm4D_y_dir_loc.clear();
|
1183 |
|
|
segm4D_z_dir_loc.clear();
|
1184 |
pellicci |
1.8 |
segm4D_cosx.clear();
|
1185 |
|
|
segm4D_cosy.clear();
|
1186 |
|
|
segm4D_cosz.clear();
|
1187 |
pellicci |
1.1 |
segm4D_phi.clear();
|
1188 |
|
|
segm4D_theta.clear();
|
1189 |
|
|
segm4D_eta.clear();
|
1190 |
|
|
segm4D_t0.clear();
|
1191 |
dtdqm |
1.16 |
segm4D_vdrift.clear();
|
1192 |
pellicci |
1.1 |
segm4D_phinormchi2.clear();
|
1193 |
|
|
segm4D_phinhits.clear();
|
1194 |
|
|
segm4D_znormchi2.clear();
|
1195 |
|
|
segm4D_znhits.clear();
|
1196 |
|
|
|
1197 |
|
|
segm4D_phiHits_Pos->Clear();
|
1198 |
battilan |
1.24 |
segm4D_phiHits_PosCh->Clear();
|
1199 |
pellicci |
1.1 |
segm4D_phiHits_PosErr->Clear();
|
1200 |
|
|
segm4D_phiHits_Side->Clear();
|
1201 |
pellicci |
1.23 |
segm4D_phiHits_Wire->Clear();
|
1202 |
|
|
segm4D_phiHits_Layer->Clear();
|
1203 |
pellicci |
1.1 |
|
1204 |
|
|
segm4D_zHits_Pos->Clear();
|
1205 |
battilan |
1.24 |
segm4D_zHits_PosCh->Clear();
|
1206 |
pellicci |
1.1 |
segm4D_zHits_PosErr->Clear();
|
1207 |
|
|
segm4D_zHits_Side->Clear();
|
1208 |
pellicci |
1.23 |
segm4D_zHits_Wire->Clear();
|
1209 |
|
|
segm4D_zHits_Layer->Clear();
|
1210 |
pellicci |
1.1 |
|
1211 |
|
|
//CSC segment variables
|
1212 |
|
|
cscsegm_ring.clear();
|
1213 |
|
|
cscsegm_chamber.clear();
|
1214 |
|
|
cscsegm_station.clear();
|
1215 |
pellicci |
1.8 |
cscsegm_cosx.clear();
|
1216 |
|
|
cscsegm_cosy.clear();
|
1217 |
|
|
cscsegm_cosz.clear();
|
1218 |
pellicci |
1.1 |
cscsegm_phi.clear();
|
1219 |
|
|
cscsegm_eta.clear();
|
1220 |
|
|
cscsegm_normchi2.clear();
|
1221 |
|
|
cscsegm_nRecHits.clear();
|
1222 |
|
|
|
1223 |
|
|
//DCC variables
|
1224 |
|
|
ltDCC_wheel.clear();
|
1225 |
|
|
ltDCC_sector.clear();
|
1226 |
|
|
ltDCC_station.clear();
|
1227 |
|
|
ltDCC_quality.clear();
|
1228 |
|
|
ltDCC_bx.clear();
|
1229 |
|
|
ltDCC_phi.clear();
|
1230 |
|
|
ltDCC_phiB.clear();
|
1231 |
|
|
ltDCC_is2nd.clear();
|
1232 |
|
|
|
1233 |
gmasetti |
1.15 |
ltDCC_thWheel.clear();
|
1234 |
|
|
ltDCC_thSector.clear();
|
1235 |
|
|
ltDCC_thStation.clear();
|
1236 |
|
|
ltDCC_thBx.clear();
|
1237 |
guiducci |
1.30 |
ltDCC_thHits.clear();
|
1238 |
gmasetti |
1.15 |
|
1239 |
guiducci |
1.31 |
ltDCCemu_wheel.clear();
|
1240 |
|
|
ltDCCemu_sector.clear();
|
1241 |
|
|
ltDCCemu_station.clear();
|
1242 |
|
|
ltDCCemu_quality.clear();
|
1243 |
|
|
ltDCCemu_bx.clear();
|
1244 |
|
|
ltDCCemu_phi.clear();
|
1245 |
|
|
ltDCCemu_phiB.clear();
|
1246 |
|
|
ltDCCemu_is2nd.clear();
|
1247 |
|
|
|
1248 |
|
|
ltDCCemu_thWheel.clear();
|
1249 |
|
|
ltDCCemu_thSector.clear();
|
1250 |
|
|
ltDCCemu_thStation.clear();
|
1251 |
|
|
ltDCCemu_thBx.clear();
|
1252 |
|
|
ltDCCemu_thHits.clear();
|
1253 |
|
|
|
1254 |
|
|
|
1255 |
pellicci |
1.1 |
//DDU variables
|
1256 |
|
|
ltDDU_wheel.clear();
|
1257 |
|
|
ltDDU_sector.clear();
|
1258 |
|
|
ltDDU_station.clear();
|
1259 |
|
|
ltDDU_bx.clear();
|
1260 |
|
|
ltDDU_phiQual.clear();
|
1261 |
|
|
ltDDU_thQual.clear();
|
1262 |
|
|
ltDDU_is2nd.clear();
|
1263 |
|
|
|
1264 |
|
|
//muon variables
|
1265 |
|
|
STAMu_isMuGlobal.clear();
|
1266 |
pellicci |
1.10 |
STAMu_isMuTracker.clear();
|
1267 |
pellicci |
1.1 |
STAMu_numberOfChambers.clear();
|
1268 |
|
|
STAMu_numberOfMatches.clear();
|
1269 |
|
|
STAMu_numberOfHits.clear();
|
1270 |
|
|
STAMu_segmIndex.clear();
|
1271 |
|
|
|
1272 |
|
|
Mu_px_mu.clear();
|
1273 |
|
|
Mu_py_mu.clear();
|
1274 |
|
|
Mu_pz_mu.clear();
|
1275 |
|
|
Mu_phi_mu.clear();
|
1276 |
|
|
Mu_eta_mu.clear();
|
1277 |
|
|
STAMu_recHitsSize.clear();
|
1278 |
|
|
STAMu_normchi2Mu.clear();
|
1279 |
|
|
STAMu_chargeMu.clear();
|
1280 |
|
|
STAMu_dxyMu.clear();
|
1281 |
|
|
STAMu_dzMu.clear();
|
1282 |
|
|
|
1283 |
|
|
GLBMu_normchi2Mu.clear();
|
1284 |
|
|
GLBMu_dxyMu.clear();
|
1285 |
|
|
GLBMu_dzMu.clear();
|
1286 |
|
|
|
1287 |
battilan |
1.17 |
GLBMu_numberOfPixelHits.clear();
|
1288 |
|
|
GLBMu_numberOfTrackerHits.clear();
|
1289 |
|
|
|
1290 |
pellicci |
1.1 |
GLBMu_tkIsoR03.clear();
|
1291 |
|
|
GLBMu_ntkIsoR03.clear();
|
1292 |
|
|
GLBMu_emIsoR03.clear();
|
1293 |
|
|
GLBMu_hadIsoR03.clear();
|
1294 |
|
|
|
1295 |
|
|
STAMu_caloCompatibility.clear();
|
1296 |
|
|
|
1297 |
|
|
STAMu_z_mb2.clear();
|
1298 |
|
|
STAMu_phi_mb2.clear();
|
1299 |
|
|
STAMu_pseta_mb2.clear();
|
1300 |
|
|
|
1301 |
|
|
//GMT
|
1302 |
|
|
gmt_bx.clear();
|
1303 |
|
|
gmt_phi.clear();
|
1304 |
|
|
gmt_eta.clear();
|
1305 |
|
|
gmt_pt.clear();
|
1306 |
|
|
gmt_qual.clear();
|
1307 |
|
|
gmt_detector.clear();
|
1308 |
|
|
|
1309 |
|
|
gmt_cands_fwd.clear();
|
1310 |
|
|
gmt_cands_isRpc.clear();
|
1311 |
|
|
gmt_cands_bx.clear();
|
1312 |
|
|
gmt_cands_phi.clear();
|
1313 |
|
|
gmt_cands_eta.clear();
|
1314 |
|
|
gmt_cands_pt.clear();
|
1315 |
|
|
gmt_cands_qual.clear();
|
1316 |
pellicci |
1.6 |
gmt_cands_ismatched.clear();
|
1317 |
pellicci |
1.1 |
|
1318 |
battilan |
1.17 |
//GT
|
1319 |
|
|
gt_algo_bit.clear();
|
1320 |
|
|
gt_algo_bx.clear();
|
1321 |
|
|
gt_tt_bit.clear();
|
1322 |
|
|
gt_tt_bx.clear();
|
1323 |
|
|
|
1324 |
|
|
//HLT
|
1325 |
|
|
hlt_path.clear();
|
1326 |
|
|
|
1327 |
guiducci |
1.32 |
// RPC rec hits
|
1328 |
guiducci |
1.33 |
rpc_region.clear();
|
1329 |
guiducci |
1.32 |
rpc_clusterSize.clear();
|
1330 |
|
|
rpc_strip.clear();
|
1331 |
|
|
rpc_bx.clear();
|
1332 |
|
|
rpc_station.clear();
|
1333 |
|
|
rpc_sector.clear();
|
1334 |
|
|
rpc_layer.clear();
|
1335 |
|
|
rpc_subsector.clear();
|
1336 |
|
|
rpc_roll.clear();
|
1337 |
|
|
rpc_ring.clear();
|
1338 |
|
|
|
1339 |
pellicci |
1.1 |
return;
|
1340 |
|
|
}
|
1341 |
|
|
|
1342 |
|
|
void TTreeGenerator::initialize_Tree_variables()
|
1343 |
|
|
{
|
1344 |
|
|
//Event variables
|
1345 |
|
|
runnumber = 0;
|
1346 |
|
|
lumiblock = 0;
|
1347 |
|
|
eventNumber = 0;
|
1348 |
|
|
timestamp = 0.;
|
1349 |
|
|
bunchXing = 0;
|
1350 |
|
|
orbitNum = 0;
|
1351 |
|
|
|
1352 |
|
|
PV_x = 0.;
|
1353 |
|
|
PV_y = 0.;
|
1354 |
|
|
PV_z = 0.;
|
1355 |
|
|
PV_xxE = 0.;
|
1356 |
|
|
PV_yyE = 0.;
|
1357 |
|
|
PV_zzE = 0.;
|
1358 |
|
|
PV_xyE = 0.;
|
1359 |
|
|
PV_xzE = 0.;
|
1360 |
|
|
PV_yzE = 0.;
|
1361 |
|
|
PV_normchi2 = 0.;
|
1362 |
pellicci |
1.29 |
PV_Nvtx = 0.;
|
1363 |
pellicci |
1.1 |
|
1364 |
pellicci |
1.28 |
lumiperblock = 0.;
|
1365 |
|
|
beam1Intensity = 0.;
|
1366 |
|
|
beam2Intensity = 0.;
|
1367 |
|
|
|
1368 |
pellicci |
1.1 |
segm4D_phiHits_Pos = new TClonesArray("TVectorF",dtsegmentsSize_);
|
1369 |
battilan |
1.24 |
segm4D_phiHits_PosCh = new TClonesArray("TVectorF",dtsegmentsSize_);
|
1370 |
pellicci |
1.1 |
segm4D_phiHits_PosErr = new TClonesArray("TVectorF",dtsegmentsSize_);
|
1371 |
|
|
segm4D_phiHits_Side = new TClonesArray("TVectorF",dtsegmentsSize_);
|
1372 |
pellicci |
1.23 |
segm4D_phiHits_Wire = new TClonesArray("TVectorF",dtsegmentsSize_);
|
1373 |
|
|
segm4D_phiHits_Layer = new TClonesArray("TVectorF",dtsegmentsSize_);
|
1374 |
pellicci |
1.1 |
|
1375 |
|
|
segm4D_zHits_Pos = new TClonesArray("TVectorF",dtsegmentsSize_);
|
1376 |
battilan |
1.24 |
segm4D_zHits_PosCh = new TClonesArray("TVectorF",dtsegmentsSize_);
|
1377 |
pellicci |
1.1 |
segm4D_zHits_PosErr = new TClonesArray("TVectorF",dtsegmentsSize_);
|
1378 |
|
|
segm4D_zHits_Side = new TClonesArray("TVectorF",dtsegmentsSize_);
|
1379 |
pellicci |
1.23 |
segm4D_zHits_Wire = new TClonesArray("TVectorF",dtsegmentsSize_);
|
1380 |
|
|
segm4D_zHits_Layer = new TClonesArray("TVectorF",dtsegmentsSize_);
|
1381 |
pellicci |
1.1 |
|
1382 |
|
|
return;
|
1383 |
|
|
}
|
1384 |
|
|
|
1385 |
|
|
TrajectoryStateOnSurface TTreeGenerator::cylExtrapTrkSam(reco::TrackRef track, const float rho) const
|
1386 |
|
|
{
|
1387 |
|
|
Cylinder::PositionType pos(0.,0.,0.);
|
1388 |
|
|
Cylinder::RotationType rot;
|
1389 |
|
|
Cylinder::CylinderPointer myCylinder = Cylinder::build(pos, rot, rho);
|
1390 |
|
|
|
1391 |
|
|
FreeTrajectoryState recoStart = freeTrajStateMuon(track);
|
1392 |
|
|
TrajectoryStateOnSurface recoProp;
|
1393 |
|
|
recoProp = propagatorAlong->propagate(recoStart, *myCylinder);
|
1394 |
|
|
if (!recoProp.isValid()) {
|
1395 |
|
|
recoProp = propagatorOpposite->propagate(recoStart, *myCylinder);
|
1396 |
|
|
}
|
1397 |
|
|
return recoProp;
|
1398 |
|
|
}
|
1399 |
|
|
|
1400 |
|
|
FreeTrajectoryState TTreeGenerator::freeTrajStateMuon(const reco::TrackRef track) const
|
1401 |
|
|
{
|
1402 |
|
|
const GlobalPoint innerPoint(track->innerPosition().x(),track->innerPosition().y(),track->innerPosition().z());
|
1403 |
|
|
const GlobalVector innerVec (track->innerMomentum().x(),track->innerMomentum().y(),track->innerMomentum().z());
|
1404 |
|
|
|
1405 |
|
|
FreeTrajectoryState recoStart(innerPoint, innerVec, track->charge(), &*theBField);
|
1406 |
|
|
|
1407 |
|
|
return recoStart;
|
1408 |
|
|
}
|
1409 |
|
|
|
1410 |
|
|
|
1411 |
|
|
//define this as a plug-in
|
1412 |
|
|
DEFINE_FWK_MODULE(TTreeGenerator);
|
1413 |
guiducci |
1.31 |
|