1 |
querten |
1.1 |
// -*- C++ -*-
|
2 |
|
|
//
|
3 |
|
|
// Package: Frog_Analyzer
|
4 |
|
|
// Class: Frog_Analyzer
|
5 |
|
|
//
|
6 |
|
|
/**\class Frog_Analyzer Frog_Analyzer.cc Visualisation/Frog/src/Frog_Analyzer.cc
|
7 |
|
|
|
8 |
|
|
Description: <one line class summary>
|
9 |
|
|
|
10 |
|
|
Implementation:
|
11 |
|
|
<Notes on implementation>
|
12 |
|
|
*/
|
13 |
|
|
//
|
14 |
|
|
// Original Author: Loic QUERTENMONT
|
15 |
|
|
// Created: Fri Oct 26 07:22:12 CEST 2007
|
16 |
querten |
1.43 |
// $Id: Frog_Analyzer.cc,v 1.42 2008/10/05 12:03:55 querten Exp $
|
17 |
querten |
1.1 |
//
|
18 |
|
|
//
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
// system include files
|
22 |
|
|
#include <memory>
|
23 |
|
|
|
24 |
|
|
// user include files
|
25 |
|
|
#include "FWCore/Framework/interface/Frameworkfwd.h"
|
26 |
|
|
#include "FWCore/Framework/interface/EDAnalyzer.h"
|
27 |
|
|
|
28 |
|
|
#include "FWCore/Framework/interface/Event.h"
|
29 |
|
|
#include "FWCore/Framework/interface/MakerMacros.h"
|
30 |
|
|
|
31 |
|
|
#include "FWCore/ParameterSet/interface/ParameterSet.h"
|
32 |
|
|
#include "FWCore/ServiceRegistry/interface/Service.h"
|
33 |
|
|
#include "FWCore/Framework/interface/ESHandle.h"
|
34 |
|
|
|
35 |
|
|
#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
|
36 |
|
|
#include "Geometry/CommonDetUnit/interface/GeomDetUnit.h"
|
37 |
|
|
#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
|
38 |
|
|
#include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
|
39 |
|
|
#include "Geometry/CommonTopologies/interface/PixelTopology.h"
|
40 |
|
|
#include "Geometry/CommonTopologies/interface/StripTopology.h"
|
41 |
|
|
#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetType.h"
|
42 |
|
|
#include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetType.h"
|
43 |
|
|
#include "Geometry/TrackerGeometryBuilder/interface/PixelGeomDetUnit.h"
|
44 |
|
|
#include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
|
45 |
|
|
#include "DataFormats/GeometrySurface/interface/BoundSurface.h"
|
46 |
|
|
#include "DataFormats/DetId/interface/DetId.h"
|
47 |
|
|
|
48 |
|
|
#include "Geometry/CaloEventSetup/interface/CaloTopologyRecord.h"
|
49 |
|
|
#include "Geometry/Records/interface/IdealGeometryRecord.h"
|
50 |
|
|
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
|
51 |
|
|
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
|
52 |
querten |
1.28 |
//#include "Geometry/EcalBarrelAlgo/interface/EcalBarrelGeometry.h"
|
53 |
|
|
//#include "Geometry/EcalEndcapAlgo/interface/EcalEndcapGeometry.h"
|
54 |
|
|
#include "Geometry/Records/interface/CaloGeometryRecord.h"
|
55 |
querten |
1.43 |
|
56 |
querten |
1.28 |
#include "Geometry/EcalAlgo/interface/EcalBarrelGeometry.h"
|
57 |
|
|
#include "Geometry/EcalAlgo/interface/EcalEndcapGeometry.h"
|
58 |
querten |
1.1 |
#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
|
59 |
|
|
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
|
60 |
|
|
|
61 |
|
|
#include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
|
62 |
|
|
#include "Geometry/Records/interface/MuonGeometryRecord.h"
|
63 |
|
|
#include "Geometry/DTGeometry/interface/DTGeometry.h"
|
64 |
|
|
#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
|
65 |
|
|
#include "Geometry/RPCGeometry/interface/RPCGeometry.h"
|
66 |
|
|
|
67 |
querten |
1.37 |
#include "DataFormats/Common/interface/DetSetVector.h"
|
68 |
|
|
#include "DataFormats/Common/interface/DetSetVectorNew.h"
|
69 |
|
|
|
70 |
|
|
#include "DataFormats/SiStripCluster/interface/SiStripClusterCollection.h"
|
71 |
querten |
1.1 |
|
72 |
|
|
#include "DataFormats/CaloRecHit/interface/CaloRecHit.h"
|
73 |
|
|
#include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
|
74 |
|
|
#include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
|
75 |
|
|
|
76 |
|
|
#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
|
77 |
|
|
#include "SimDataFormats/TrackingHit/interface/PSimHit.h"
|
78 |
|
|
#include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h"
|
79 |
|
|
#include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
|
80 |
|
|
#include "SimDataFormats/CaloHit/interface/PCaloHit.h"
|
81 |
|
|
#include "SimDataFormats/Track/interface/SimTrack.h"
|
82 |
|
|
#include "SimDataFormats/Vertex/interface/SimVertex.h"
|
83 |
|
|
|
84 |
|
|
#include "DataFormats/Provenance/interface/BranchDescription.h"
|
85 |
|
|
#include "DataFormats/Provenance/interface/Provenance.h"
|
86 |
|
|
#include "DataFormats/Candidate/interface/Candidate.h"
|
87 |
|
|
#include "DataFormats/HepMCCandidate/interface/GenParticleCandidate.h"
|
88 |
|
|
#include "DataFormats/RecoCandidate/interface/RecoChargedCandidate.h"
|
89 |
|
|
#include "DataFormats/TrackReco/interface/Track.h"
|
90 |
roberfro |
1.5 |
#include "TrackingTools/PatternTools/interface/Trajectory.h"
|
91 |
querten |
1.6 |
#include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
|
92 |
|
|
|
93 |
querten |
1.36 |
#include "DataFormats/HepMCCandidate/interface/GenParticle.h"
|
94 |
|
|
|
95 |
querten |
1.1 |
|
96 |
querten |
1.2 |
#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
|
97 |
|
|
#include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
|
98 |
|
|
|
99 |
|
|
#include "DataFormats/DTRecHit/interface/DTRecHitCollection.h"
|
100 |
|
|
#include "DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h"
|
101 |
|
|
#include "DataFormats/RPCRecHit/interface/RPCRecHitCollection.h"
|
102 |
|
|
|
103 |
querten |
1.1 |
#include "DataFormats/Math/interface/Point3D.h"
|
104 |
|
|
#include "DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h"
|
105 |
|
|
#include "DataFormats/GeometrySurface/interface/RectangularPlaneBounds.h"
|
106 |
|
|
|
107 |
querten |
1.11 |
#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
|
108 |
|
|
#include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
|
109 |
|
|
#include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
|
110 |
|
|
#include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
|
111 |
|
|
#include "DataFormats/SiStripDetId/interface/TIBDetId.h"
|
112 |
|
|
#include "DataFormats/SiStripDetId/interface/TIDDetId.h"
|
113 |
|
|
#include "DataFormats/SiStripDetId/interface/TOBDetId.h"
|
114 |
|
|
#include "DataFormats/SiStripDetId/interface/TECDetId.h"
|
115 |
|
|
|
116 |
|
|
#include "DataFormats/MuonDetId/interface/DTChamberId.h"
|
117 |
|
|
#include "DataFormats/MuonDetId/interface/CSCDetId.h"
|
118 |
|
|
#include "DataFormats/MuonDetId/interface/RPCDetId.h"
|
119 |
|
|
|
120 |
|
|
#include "DataFormats/EcalDetId/interface/EBDetId.h"
|
121 |
|
|
#include "DataFormats/EcalDetId/interface/EEDetId.h"
|
122 |
|
|
#include "DataFormats/EcalDetId/interface/ESDetId.h"
|
123 |
|
|
#include "DataFormats/HcalDetId/interface/HcalDetId.h"
|
124 |
|
|
|
125 |
querten |
1.28 |
#include "DataFormats/VertexReco/interface/NuclearInteraction.h"
|
126 |
|
|
|
127 |
|
|
#include "DataFormats/JetReco/interface/Jet.h"
|
128 |
|
|
#include "DataFormats/JetReco/interface/BasicJetCollection.h"
|
129 |
|
|
#include "DataFormats/JetReco/interface/GenJetCollection.h"
|
130 |
|
|
#include "DataFormats/JetReco/interface/CaloJetCollection.h"
|
131 |
|
|
#include "DataFormats/JetReco/interface/PFJetCollection.h"
|
132 |
roberfro |
1.38 |
#include "DataFormats/METReco/interface/CaloMET.h"
|
133 |
|
|
#include "DataFormats/METReco/interface/CaloMETFwd.h"
|
134 |
querten |
1.28 |
|
135 |
querten |
1.41 |
//#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Base_With_DetId_And_Name.h"
|
136 |
querten |
1.11 |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Tools.h"
|
137 |
|
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Tools.cpp"
|
138 |
roberfro |
1.13 |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Event_Track.h"
|
139 |
|
|
|
140 |
|
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Events.h"
|
141 |
|
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Events.cpp"
|
142 |
|
|
|
143 |
|
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Geometry.h"
|
144 |
|
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Geometry.cpp"
|
145 |
querten |
1.11 |
|
146 |
roberfro |
1.13 |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_DetId.h"
|
147 |
querten |
1.18 |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_ReadCards.cpp"
|
148 |
querten |
1.28 |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Event_NuclInt.h"
|
149 |
querten |
1.27 |
|
150 |
querten |
1.36 |
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Coord.h"
|
151 |
|
|
#include "Visualisation/Frog/soft/Includes/FROG/FROG_Coord.cpp"
|
152 |
|
|
|
153 |
querten |
1.1 |
|
154 |
roberfro |
1.24 |
|
155 |
querten |
1.1 |
using namespace edm;
|
156 |
|
|
using namespace std;
|
157 |
querten |
1.28 |
using namespace reco;
|
158 |
querten |
1.1 |
|
159 |
|
|
//
|
160 |
|
|
// class decleration
|
161 |
|
|
//
|
162 |
|
|
|
163 |
|
|
class Frog_Analyzer : public edm::EDAnalyzer {
|
164 |
|
|
public:
|
165 |
|
|
explicit Frog_Analyzer(const edm::ParameterSet&);
|
166 |
|
|
~Frog_Analyzer();
|
167 |
|
|
|
168 |
|
|
|
169 |
|
|
private:
|
170 |
|
|
virtual void beginJob(const edm::EventSetup& iSetup);
|
171 |
|
|
virtual void analyze (const edm::Event&, const edm::EventSetup&);
|
172 |
|
|
virtual void endJob ();
|
173 |
|
|
|
174 |
querten |
1.15 |
FROG_Element_Base* events_prim;
|
175 |
querten |
1.1 |
|
176 |
querten |
1.11 |
std::string OutputFile;
|
177 |
querten |
1.1 |
|
178 |
querten |
1.40 |
std::vector<InputTag> GenParticlesProducers;
|
179 |
querten |
1.36 |
|
180 |
querten |
1.1 |
std::vector<InputTag> SimTrackProducers;
|
181 |
|
|
std::vector<InputTag> SimVertexProducers;
|
182 |
|
|
std::vector<InputTag> SimHitProducers;
|
183 |
querten |
1.25 |
std::vector<InputTag> SimCaloHitProducers;
|
184 |
|
|
|
185 |
roberfro |
1.24 |
std::vector<InputTag> NIProducers;
|
186 |
querten |
1.1 |
|
187 |
querten |
1.9 |
std::vector<InputTag> TrackProducers;
|
188 |
roberfro |
1.5 |
std::vector<InputTag> TrajectoryProducers;
|
189 |
querten |
1.37 |
std::vector<InputTag> SiStripClusterProducers;
|
190 |
querten |
1.1 |
std::vector<InputTag> EcalRecHitProducers;
|
191 |
|
|
std::vector<InputTag> HcalHBHERecHitProducers;
|
192 |
|
|
std::vector<InputTag> HcalHORecHitProducers;
|
193 |
|
|
std::vector<InputTag> HcalHFRecHitProducers;
|
194 |
querten |
1.2 |
std::vector<InputTag> DTSegmentProducers;
|
195 |
|
|
std::vector<InputTag> CSCSegmentProducers;
|
196 |
|
|
|
197 |
|
|
std::vector<InputTag> RPCHitsProducers;
|
198 |
querten |
1.1 |
|
199 |
querten |
1.35 |
std::vector<InputTag> CaloTowersProducers;
|
200 |
|
|
bool CaloTowersProducersBasedOnCaloHits;
|
201 |
|
|
|
202 |
querten |
1.33 |
std::vector<InputTag> BasicJetsProducers;
|
203 |
querten |
1.28 |
std::vector<InputTag> CaloJetsProducers;
|
204 |
querten |
1.35 |
bool CaloJetsProducersBasedOnCaloTowers;
|
205 |
querten |
1.28 |
|
206 |
querten |
1.36 |
std::vector<InputTag> RecoCandidateProducers;
|
207 |
roberfro |
1.38 |
std::vector<InputTag> CaloMETProducers;
|
208 |
querten |
1.36 |
|
209 |
|
|
|
210 |
querten |
1.22 |
// ----------member data ---------------------------
|
211 |
|
|
|
212 |
|
|
bool ProduceGeom;
|
213 |
|
|
int NEventsInVisFile;
|
214 |
|
|
int NEvents;
|
215 |
querten |
1.1 |
|
216 |
querten |
1.22 |
unsigned int SRun;
|
217 |
|
|
unsigned int SEvent;
|
218 |
querten |
1.1 |
};
|
219 |
|
|
|
220 |
|
|
//
|
221 |
|
|
// constructors and destructor
|
222 |
|
|
//
|
223 |
|
|
Frog_Analyzer::Frog_Analyzer(const edm::ParameterSet& iConfig)
|
224 |
|
|
{
|
225 |
|
|
OutputFile = iConfig.getParameter<std::string >("OutputFile");
|
226 |
|
|
|
227 |
querten |
1.40 |
GenParticlesProducers = iConfig.getParameter<std::vector<InputTag> >("GenParticlesProducers");
|
228 |
querten |
1.36 |
|
229 |
querten |
1.1 |
SimTrackProducers = iConfig.getParameter<std::vector<InputTag> >("SimTrackProducers");
|
230 |
|
|
SimVertexProducers = iConfig.getParameter<std::vector<InputTag> >("SimVertexProducers");
|
231 |
|
|
SimHitProducers = iConfig.getParameter<std::vector<InputTag> >("SimHitProducers");
|
232 |
querten |
1.25 |
SimCaloHitProducers = iConfig.getParameter<std::vector<InputTag> >("SimCaloHitProducers");
|
233 |
|
|
|
234 |
querten |
1.1 |
|
235 |
querten |
1.10 |
TrackProducers = iConfig.getParameter<std::vector<InputTag> >("TrackProducers");
|
236 |
querten |
1.9 |
TrajectoryProducers = iConfig.getParameter<std::vector<InputTag> >("TrajectoryProducers");
|
237 |
querten |
1.37 |
SiStripClusterProducers = iConfig.getParameter<std::vector<InputTag> >("SiStripClusterProducers");
|
238 |
querten |
1.1 |
EcalRecHitProducers = iConfig.getParameter<std::vector<InputTag> >("EcalRecHitProducers");
|
239 |
|
|
HcalHBHERecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHBHERecHitProducers");
|
240 |
|
|
HcalHORecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHORecHitProducers");
|
241 |
|
|
HcalHFRecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHFRecHitProducers");
|
242 |
|
|
|
243 |
roberfro |
1.24 |
NIProducers = iConfig.getParameter<std::vector<InputTag> >("NIProducers");
|
244 |
|
|
|
245 |
querten |
1.2 |
DTSegmentProducers = iConfig.getParameter<std::vector<InputTag> >("DTSegmentProducers");
|
246 |
|
|
CSCSegmentProducers = iConfig.getParameter<std::vector<InputTag> >("CSCSegmentProducers");
|
247 |
|
|
|
248 |
|
|
RPCHitsProducers = iConfig.getParameter<std::vector<InputTag> >("RPCHitsProducers");
|
249 |
|
|
|
250 |
querten |
1.35 |
CaloTowersProducers = iConfig.getParameter<std::vector<InputTag> >("CaloTowersProducers");
|
251 |
|
|
CaloTowersProducersBasedOnCaloHits = iConfig.getParameter<bool>("CaloTowersProducersBasedOnCaloHits");
|
252 |
|
|
|
253 |
|
|
|
254 |
querten |
1.33 |
BasicJetsProducers = iConfig.getParameter<std::vector<InputTag> >("BasicJetsProducers");
|
255 |
querten |
1.28 |
CaloJetsProducers = iConfig.getParameter<std::vector<InputTag> >("CaloJetsProducers");
|
256 |
querten |
1.35 |
CaloJetsProducersBasedOnCaloTowers = iConfig.getParameter<bool>("CaloJetsProducersBasedOnCaloTowers");
|
257 |
querten |
1.28 |
|
258 |
querten |
1.36 |
RecoCandidateProducers = iConfig.getParameter<std::vector<InputTag> >("RecoCandidateProducers");
|
259 |
roberfro |
1.38 |
CaloMETProducers = iConfig.getParameter<std::vector<InputTag> >("CaloMETProducers");
|
260 |
querten |
1.36 |
|
261 |
querten |
1.22 |
ProduceGeom = iConfig.getParameter<bool >("ProduceGeom" );
|
262 |
|
|
NEventsInVisFile = iConfig.getParameter<int >("NEventsInVisFile" );
|
263 |
|
|
|
264 |
|
|
NEvents = 0;
|
265 |
querten |
1.1 |
}
|
266 |
|
|
|
267 |
|
|
|
268 |
|
|
Frog_Analyzer::~Frog_Analyzer()
|
269 |
|
|
{
|
270 |
|
|
}
|
271 |
|
|
|
272 |
|
|
// ------------ method called once each job just before starting event loop ------------
|
273 |
|
|
void
|
274 |
|
|
Frog_Analyzer::beginJob(const edm::EventSetup& iSetup)
|
275 |
|
|
{
|
276 |
querten |
1.22 |
if(ProduceGeom){
|
277 |
|
|
DetId Detid;
|
278 |
|
|
unsigned int SubDet;
|
279 |
|
|
|
280 |
|
|
unsigned int Frog_DetId;
|
281 |
|
|
FROG_Element_Base* FEB = NULL;
|
282 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* FEB_Temp = NULL;
|
283 |
querten |
1.22 |
|
284 |
|
|
FROG_Element_Base* prim = new FROG_Element_Base(C_PRIMARY);
|
285 |
querten |
1.41 |
FROG_Element_Base* geom = new FROG_Element_Base(C_GEOMETRY); prim->addDaughter(geom);
|
286 |
|
|
FROG_Element_Base_With_DetId_And_Name* tracker = new FROG_Element_Base_With_DetId_And_Name( DETID_TRK , "Tracker"); geom->addDaughter(tracker);
|
287 |
|
|
FROG_Element_Base_With_DetId_And_Name* muon = new FROG_Element_Base_With_DetId_And_Name( DETID_MUON , "Muon"); geom->addDaughter(muon);
|
288 |
|
|
FROG_Element_Base_With_DetId_And_Name* ecal = new FROG_Element_Base_With_DetId_And_Name( DETID_ECAL , "ECAL"); geom->addDaughter(ecal);
|
289 |
|
|
FROG_Element_Base_With_DetId_And_Name* hcal = new FROG_Element_Base_With_DetId_And_Name( DETID_HCAL , "HCAL"); geom->addDaughter(hcal);
|
290 |
|
|
FROG_Element_Base_With_DetId_And_Name* calo = new FROG_Element_Base_With_DetId_And_Name( DETID_CALO , "Calo"); geom->addDaughter(calo);
|
291 |
querten |
1.34 |
|
292 |
querten |
1.22 |
|
293 |
|
|
|
294 |
|
|
// ### TRACKER GEOMETRY ###
|
295 |
|
|
|
296 |
|
|
edm::ESHandle<TrackerGeometry> tkGeom;
|
297 |
|
|
iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom );
|
298 |
|
|
vector<GeomDet*> TrackerDets = tkGeom->dets();
|
299 |
|
|
|
300 |
|
|
for(unsigned int i=0;i<TrackerDets.size();i++){
|
301 |
|
|
Detid = TrackerDets[i]->geographicalId();
|
302 |
|
|
SubDet = Detid.subdetId();
|
303 |
|
|
if(SubDet<1 || SubDet>6) continue;
|
304 |
querten |
1.11 |
|
305 |
querten |
1.1 |
|
306 |
querten |
1.22 |
GeomDet* DetUnit = TrackerDets[i];
|
307 |
|
|
if(!DetUnit)continue;
|
308 |
|
|
const BoundPlane plane = DetUnit->surface();
|
309 |
|
|
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds())));
|
310 |
|
|
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds())));
|
311 |
|
|
|
312 |
|
|
float width = 0;
|
313 |
|
|
float length = 0;
|
314 |
|
|
float thickness = 0;
|
315 |
|
|
float TrapezoidalParam = 0;
|
316 |
|
|
|
317 |
|
|
if(trapezoidalBounds){
|
318 |
|
|
std::vector<float> const & parameters = (*trapezoidalBounds).parameters();
|
319 |
|
|
width = parameters[0]*2;
|
320 |
|
|
length = parameters[3]*2;
|
321 |
|
|
thickness = (*trapezoidalBounds).thickness();
|
322 |
|
|
TrapezoidalParam = parameters[1]/parameters[0];
|
323 |
|
|
}else if(rectangularBounds){
|
324 |
|
|
width = DetUnit->surface().bounds().width();
|
325 |
|
|
length = DetUnit->surface().bounds().length();
|
326 |
|
|
thickness = DetUnit->surface().bounds().thickness();
|
327 |
|
|
TrapezoidalParam = 1;
|
328 |
|
|
}
|
329 |
querten |
1.1 |
|
330 |
querten |
1.22 |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) );
|
331 |
|
|
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) );
|
332 |
|
|
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) );
|
333 |
|
|
|
334 |
|
|
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector());
|
335 |
|
|
|
336 |
|
|
FROG_Element_Geom_TrackerMod* mod = new FROG_Element_Geom_TrackerMod(
|
337 |
|
|
Detid.rawId(), TrapezoidalParam,
|
338 |
|
|
Pos.x(), Pos.y(), Pos.z(),
|
339 |
|
|
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(),
|
340 |
|
|
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(),
|
341 |
|
|
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z());
|
342 |
querten |
1.1 |
|
343 |
|
|
|
344 |
querten |
1.22 |
Frog_DetId = DETID_TRK;
|
345 |
|
|
FEB = tracker;
|
346 |
querten |
1.11 |
|
347 |
querten |
1.22 |
Frog_DetId += SubDet*100000;
|
348 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
349 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
350 |
querten |
1.41 |
// if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);}
|
351 |
querten |
1.11 |
|
352 |
querten |
1.22 |
if(SubDet==PixelSubdetector::PixelBarrel){
|
353 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "PIB"); FEB_Temp->addDaughter(FEB);}
|
354 |
|
|
|
355 |
querten |
1.22 |
PXBDetId detid = PXBDetId(Detid);
|
356 |
querten |
1.11 |
|
357 |
querten |
1.22 |
Frog_DetId += detid.layer()*10000;
|
358 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
359 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
360 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Layer%i", detid.layer() ); FEB_Temp->addDaughter(FEB);}
|
361 |
querten |
1.11 |
|
362 |
querten |
1.22 |
Frog_DetId += detid.ladder()*100;
|
363 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
364 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
365 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ladder%i", detid.ladder() ); FEB_Temp->addDaughter(FEB);}
|
366 |
querten |
1.22 |
}else if(SubDet==PixelSubdetector::PixelEndcap){
|
367 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "PIE"); FEB_Temp->addDaughter(FEB);}
|
368 |
|
|
|
369 |
querten |
1.22 |
PXFDetId detid = PXFDetId(Detid);
|
370 |
querten |
1.11 |
|
371 |
querten |
1.22 |
Frog_DetId += detid.side()*10000;
|
372 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
373 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
374 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%i",detid.side()); FEB_Temp->addDaughter(FEB);}
|
375 |
querten |
1.11 |
|
376 |
querten |
1.22 |
Frog_DetId += detid.disk()*1000;
|
377 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
378 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
379 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Disk%i", detid.disk()); FEB_Temp->addDaughter(FEB);}
|
380 |
querten |
1.11 |
|
381 |
querten |
1.22 |
Frog_DetId += detid.blade()*10;
|
382 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
383 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
384 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Blade%i", detid.blade()); FEB_Temp->addDaughter(FEB);}
|
385 |
querten |
1.11 |
|
386 |
querten |
1.22 |
Frog_DetId += detid.panel()*1;
|
387 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
388 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
389 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Panel%i", detid.panel()); FEB_Temp->addDaughter(FEB);}
|
390 |
querten |
1.22 |
}else if(SubDet==StripSubdetector::TIB){
|
391 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TIB"); FEB_Temp->addDaughter(FEB);}
|
392 |
|
|
|
393 |
querten |
1.22 |
TIBDetId detid = TIBDetId(Detid);
|
394 |
querten |
1.11 |
|
395 |
querten |
1.22 |
Frog_DetId += detid.layer()*10000;
|
396 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
397 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
398 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Layer%i", detid.layer()); FEB_Temp->addDaughter(FEB);}
|
399 |
querten |
1.11 |
|
400 |
querten |
1.22 |
Frog_DetId += detid.stringNumber()*100;
|
401 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
402 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
403 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "String%i", detid.stringNumber()); FEB_Temp->addDaughter(FEB);}
|
404 |
querten |
1.22 |
}else if(SubDet==StripSubdetector::TID){
|
405 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TID"); FEB_Temp->addDaughter(FEB);}
|
406 |
|
|
|
407 |
querten |
1.22 |
TIDDetId detid = TIDDetId(Detid);
|
408 |
querten |
1.11 |
|
409 |
querten |
1.22 |
Frog_DetId += detid.side()*10000;
|
410 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
411 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
412 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Slide%i", detid.side()); FEB_Temp->addDaughter(FEB);}
|
413 |
querten |
1.11 |
|
414 |
querten |
1.22 |
Frog_DetId += detid.wheel()*1000;
|
415 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
416 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
417 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Wheel%i", detid.wheel()); FEB_Temp->addDaughter(FEB);}
|
418 |
querten |
1.22 |
|
419 |
|
|
Frog_DetId += detid.ring()*10;
|
420 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
421 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
422 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
|
423 |
querten |
1.22 |
}else if(SubDet==StripSubdetector::TOB){
|
424 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TOB"); FEB_Temp->addDaughter(FEB);}
|
425 |
|
|
|
426 |
querten |
1.22 |
TOBDetId detid = TOBDetId(Detid);
|
427 |
querten |
1.11 |
|
428 |
querten |
1.22 |
Frog_DetId += detid.layer()*10000;
|
429 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
430 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
431 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Layer%i", detid.layer()); FEB_Temp->addDaughter(FEB);}
|
432 |
querten |
1.11 |
|
433 |
querten |
1.22 |
Frog_DetId += detid.rodNumber()*100;
|
434 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
435 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
436 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Rod%i", detid.rodNumber()); FEB_Temp->addDaughter(FEB);}
|
437 |
querten |
1.22 |
}else if(SubDet==StripSubdetector::TEC){
|
438 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TEC"); FEB_Temp->addDaughter(FEB);}
|
439 |
|
|
|
440 |
querten |
1.22 |
TECDetId detid = TECDetId(Detid);
|
441 |
querten |
1.11 |
|
442 |
querten |
1.22 |
Frog_DetId += detid.side()*10000;
|
443 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
444 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
445 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%i",detid.side()); FEB_Temp->addDaughter(FEB);}
|
446 |
querten |
1.11 |
|
447 |
querten |
1.22 |
Frog_DetId += detid.wheel()*1000;
|
448 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
449 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
450 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Wheel%i", detid.wheel() ); FEB_Temp->addDaughter(FEB);}
|
451 |
querten |
1.1 |
|
452 |
querten |
1.22 |
Frog_DetId += detid.ring()*10;
|
453 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
454 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
455 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
|
456 |
querten |
1.22 |
|
457 |
|
|
Frog_DetId += detid.petalNumber();
|
458 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
459 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
460 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Petal%i", detid.petalNumber()); FEB_Temp->addDaughter(FEB);}
|
461 |
querten |
1.22 |
}else{
|
462 |
|
|
if(mod)delete mod;
|
463 |
|
|
continue;
|
464 |
querten |
1.11 |
}
|
465 |
querten |
1.22 |
FEB->addDaughter(mod);
|
466 |
|
|
}
|
467 |
querten |
1.11 |
|
468 |
|
|
|
469 |
querten |
1.22 |
// ### MUON GEOMETRY ###
|
470 |
querten |
1.11 |
|
471 |
querten |
1.22 |
edm::ESHandle<DTGeometry> DtGeom;
|
472 |
|
|
iSetup.get<MuonGeometryRecord>().get( DtGeom );
|
473 |
|
|
const vector<GeomDet*> DtDets = DtGeom->dets();
|
474 |
|
|
|
475 |
|
|
edm::ESHandle<CSCGeometry> CscGeom;
|
476 |
|
|
iSetup.get<MuonGeometryRecord>().get( CscGeom );
|
477 |
|
|
const vector<GeomDet*> CscDets = CscGeom->dets();
|
478 |
|
|
|
479 |
|
|
edm::ESHandle<RPCGeometry> RpcGeom;
|
480 |
|
|
iSetup.get<MuonGeometryRecord>().get( RpcGeom );
|
481 |
|
|
const vector<GeomDet*> RpcDets = RpcGeom->dets();
|
482 |
|
|
|
483 |
|
|
vector<GeomDet*> MuonDets;
|
484 |
|
|
for(unsigned int i=0;i<DtDets.size() ;i++){MuonDets.push_back(DtDets [i]);}
|
485 |
|
|
for(unsigned int i=0;i<CscDets.size();i++){MuonDets.push_back(CscDets[i]);}
|
486 |
|
|
for(unsigned int i=0;i<RpcDets.size();i++){MuonDets.push_back(RpcDets[i]);}
|
487 |
querten |
1.1 |
|
488 |
querten |
1.22 |
for(unsigned int i=0;i<MuonDets.size();i++)
|
489 |
|
|
{
|
490 |
|
|
Detid = DetId(MuonDets[i]->geographicalId());
|
491 |
|
|
SubDet = Detid.subdetId();
|
492 |
querten |
1.1 |
|
493 |
querten |
1.22 |
GeomDet* DetUnit = MuonDets[i];
|
494 |
|
|
if(!DetUnit)continue;
|
495 |
|
|
const BoundPlane plane = DetUnit->surface();
|
496 |
|
|
const TrapezoidalPlaneBounds* trapezoidalBounds( dynamic_cast<const TrapezoidalPlaneBounds*>(&(plane.bounds())));
|
497 |
|
|
const RectangularPlaneBounds* rectangularBounds( dynamic_cast<const RectangularPlaneBounds*>(&(plane.bounds())));
|
498 |
|
|
|
499 |
|
|
float width = 0;
|
500 |
|
|
float length = 0;
|
501 |
|
|
float thickness = 0;
|
502 |
|
|
float TrapezoidalParam = 0;
|
503 |
|
|
|
504 |
|
|
if(trapezoidalBounds)
|
505 |
|
|
{
|
506 |
|
|
std::vector<float> const & parameters = (*trapezoidalBounds).parameters();
|
507 |
|
|
width = parameters[0]*2;
|
508 |
|
|
length = parameters[3]*2;
|
509 |
|
|
thickness = (*trapezoidalBounds).thickness();
|
510 |
|
|
TrapezoidalParam = parameters[1]/parameters[0];
|
511 |
|
|
}else if(rectangularBounds){
|
512 |
|
|
width = DetUnit->surface().bounds().width();
|
513 |
|
|
length = DetUnit->surface().bounds().length();
|
514 |
|
|
thickness = DetUnit->surface().bounds().thickness();
|
515 |
|
|
TrapezoidalParam = 1;
|
516 |
|
|
}
|
517 |
querten |
1.1 |
|
518 |
querten |
1.22 |
Surface::GlobalPoint WidthVector = plane.toGlobal( LocalPoint(width/2, 0, 0) );
|
519 |
|
|
Surface::GlobalPoint LengthVector = plane.toGlobal( LocalPoint(0, length/2, 0) );
|
520 |
|
|
Surface::GlobalPoint ThickVector = plane.toGlobal( LocalPoint(0, 0, thickness/2) );
|
521 |
|
|
|
522 |
|
|
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector());
|
523 |
|
|
|
524 |
|
|
FROG_Element_Geom_TrackerMod* mod = new FROG_Element_Geom_TrackerMod(
|
525 |
|
|
Detid.rawId(), TrapezoidalParam,
|
526 |
|
|
Pos.x(), Pos.y(), Pos.z(),
|
527 |
|
|
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(),
|
528 |
|
|
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(),
|
529 |
|
|
ThickVector.x() -Pos.x(), ThickVector.y() -Pos.y(), ThickVector.z() -Pos.z());
|
530 |
querten |
1.7 |
|
531 |
querten |
1.22 |
Frog_DetId = DETID_MUON;
|
532 |
|
|
FEB = muon;
|
533 |
querten |
1.7 |
|
534 |
querten |
1.11 |
Frog_DetId += SubDet*100000;
|
535 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
536 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
537 |
querten |
1.41 |
// if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);}
|
538 |
querten |
1.11 |
|
539 |
|
|
if(SubDet==1){
|
540 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "DT"); FEB_Temp->addDaughter(FEB);}
|
541 |
|
|
|
542 |
|
|
DTChamberId detid = DTChamberId(Detid);
|
543 |
querten |
1.11 |
|
544 |
querten |
1.22 |
Frog_DetId += (detid.wheel()+3)*10000;
|
545 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
546 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
547 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Wheel%+i", detid.wheel()); FEB_Temp->addDaughter(FEB);}
|
548 |
querten |
1.11 |
|
549 |
querten |
1.22 |
Frog_DetId += detid.station()*100;
|
550 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
551 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
552 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);}
|
553 |
querten |
1.11 |
|
554 |
querten |
1.22 |
Frog_DetId += detid.sector()*1;
|
555 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
556 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
557 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Sector%i", detid.sector()); FEB_Temp->addDaughter(FEB);}
|
558 |
querten |
1.11 |
}else if(SubDet==2){
|
559 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "CSC"); FEB_Temp->addDaughter(FEB);}
|
560 |
|
|
|
561 |
querten |
1.22 |
CSCDetId detid = CSCDetId(Detid);
|
562 |
|
|
|
563 |
|
|
Frog_DetId += detid.endcap()*10000;
|
564 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
565 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
566 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%i", detid.endcap()); FEB_Temp->addDaughter(FEB);}
|
567 |
querten |
1.22 |
|
568 |
|
|
Frog_DetId += detid.station()*1000;
|
569 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
570 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
571 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);}
|
572 |
querten |
1.22 |
|
573 |
|
|
Frog_DetId += detid.ring()*100;
|
574 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
575 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
576 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
|
577 |
querten |
1.22 |
|
578 |
|
|
Frog_DetId += detid.chamber()*1;
|
579 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
580 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
581 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Chamber%i", detid.chamber()); FEB_Temp->addDaughter(FEB);}
|
582 |
querten |
1.22 |
}else if(SubDet==3){
|
583 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "RPC"); FEB_Temp->addDaughter(FEB);}
|
584 |
|
|
|
585 |
querten |
1.22 |
RPCDetId detid = RPCDetId(Detid);
|
586 |
querten |
1.11 |
|
587 |
querten |
1.22 |
Frog_DetId += (detid.region()+2)*10000;
|
588 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
589 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
590 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Region+%i", detid.region()); FEB_Temp->addDaughter(FEB);}
|
591 |
querten |
1.11 |
|
592 |
querten |
1.22 |
// Barrel
|
593 |
|
|
if(detid.region()==0){
|
594 |
|
|
Frog_DetId += (detid.ring()+3)*1000;
|
595 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
596 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
597 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring+%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
|
598 |
querten |
1.22 |
// Endcap
|
599 |
|
|
}else{
|
600 |
|
|
Frog_DetId += detid.ring()*1000;
|
601 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
602 |
querten |
1.22 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
603 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring+%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
|
604 |
querten |
1.22 |
}
|
605 |
|
|
|
606 |
|
|
Frog_DetId += detid.station()*100;
|
607 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
608 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
609 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);}
|
610 |
querten |
1.11 |
|
611 |
querten |
1.22 |
Frog_DetId += detid.sector()*1;
|
612 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
613 |
querten |
1.11 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
614 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Sector%i", detid.sector()); FEB_Temp->addDaughter(FEB);}
|
615 |
querten |
1.11 |
}
|
616 |
|
|
|
617 |
querten |
1.22 |
FEB->addDaughter(mod);
|
618 |
|
|
}
|
619 |
|
|
|
620 |
|
|
|
621 |
|
|
|
622 |
|
|
// ### CALO GEOMETRY ###
|
623 |
|
|
|
624 |
|
|
edm::ESHandle<CaloGeometry> CaloGeom;
|
625 |
querten |
1.43 |
// iSetup.get<CaloGeometryRecord>().get( CaloGeom );
|
626 |
querten |
1.28 |
iSetup.get<CaloGeometryRecord>().get( CaloGeom );
|
627 |
querten |
1.22 |
const vector<DetId> CaloDets = CaloGeom->getValidDetIds();
|
628 |
querten |
1.11 |
|
629 |
querten |
1.22 |
for(unsigned int i=0;i<CaloDets.size();i++)
|
630 |
|
|
{
|
631 |
|
|
Detid = CaloDets[i];
|
632 |
|
|
SubDet = Detid.subdetId();
|
633 |
|
|
|
634 |
querten |
1.34 |
if(Detid.det()==DetId::Ecal){
|
635 |
|
|
if(SubDet<1 || SubDet>3) continue;
|
636 |
querten |
1.11 |
|
637 |
querten |
1.34 |
Frog_DetId = DETID_ECAL;
|
638 |
|
|
FEB = ecal;
|
639 |
querten |
1.11 |
|
640 |
querten |
1.34 |
Frog_DetId += SubDet*100000;
|
641 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
642 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
643 |
querten |
1.41 |
// if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);}
|
644 |
querten |
1.34 |
|
645 |
|
|
if(SubDet==1){
|
646 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "EB"); FEB_Temp->addDaughter(FEB);}
|
647 |
|
|
|
648 |
querten |
1.34 |
EBDetId detid = EBDetId(Detid);
|
649 |
|
|
|
650 |
|
|
Frog_DetId += ((detid.zside()==1)+1)*10000;
|
651 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
652 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
653 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
|
654 |
querten |
1.34 |
|
655 |
|
|
Frog_DetId += (detid.tower_ieta()*detid.zside())*100;
|
656 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
657 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
658 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TowerIEta%+i", detid.tower_ieta()); FEB_Temp->addDaughter(FEB);}
|
659 |
querten |
1.34 |
|
660 |
|
|
Frog_DetId += detid.tower_iphi()*1;
|
661 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
662 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
663 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TowerIPhi%i", detid.tower_iphi()); FEB_Temp->addDaughter(FEB);}
|
664 |
querten |
1.34 |
}else if(SubDet==2){
|
665 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "EE"); FEB_Temp->addDaughter(FEB);}
|
666 |
|
|
|
667 |
querten |
1.34 |
EEDetId detid = EEDetId(Detid);
|
668 |
|
|
|
669 |
|
|
Frog_DetId += ((detid.zside()==1)+1)*10000;
|
670 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
671 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
672 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
|
673 |
querten |
1.34 |
|
674 |
|
|
Frog_DetId += detid.iquadrant()*1000;
|
675 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
676 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
677 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Quadran%i", detid.iquadrant()); FEB_Temp->addDaughter(FEB);}
|
678 |
querten |
1.34 |
|
679 |
|
|
Frog_DetId += detid.isc();
|
680 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
681 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
682 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "ISC%i", detid.isc()); FEB_Temp->addDaughter(FEB);}
|
683 |
querten |
1.34 |
}else if(SubDet==3){
|
684 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "ES"); FEB_Temp->addDaughter(FEB);}
|
685 |
|
|
|
686 |
querten |
1.34 |
ESDetId detid = ESDetId(Detid);
|
687 |
|
|
|
688 |
|
|
Frog_DetId += ((detid.zside()==1)+1)*10000;
|
689 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
690 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
691 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
|
692 |
querten |
1.34 |
|
693 |
|
|
Frog_DetId += detid.plane()*1000;
|
694 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
695 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
696 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Plane%i", detid.plane()); FEB_Temp->addDaughter(FEB);}
|
697 |
querten |
1.34 |
|
698 |
|
|
Frog_DetId += detid.six()*50;
|
699 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
700 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
701 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Six%i", detid.six()); FEB_Temp->addDaughter(FEB);}
|
702 |
querten |
1.34 |
|
703 |
|
|
Frog_DetId += detid.siy();
|
704 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
705 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
706 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Siy%i", detid.siy()); FEB_Temp->addDaughter(FEB);}
|
707 |
querten |
1.34 |
}
|
708 |
|
|
}else if(Detid.det()==DetId::Hcal){
|
709 |
|
|
if(SubDet<1 || SubDet>4) continue;
|
710 |
|
|
|
711 |
|
|
Frog_DetId = DETID_HCAL;
|
712 |
|
|
FEB = hcal;
|
713 |
|
|
|
714 |
|
|
Frog_DetId += SubDet*100000;
|
715 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
716 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
717 |
querten |
1.41 |
if(FEB==NULL){
|
718 |
|
|
if(SubDet==1){ FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HB"); FEB_Temp->addDaughter(FEB);}
|
719 |
|
|
if(SubDet==2){ FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HE"); FEB_Temp->addDaughter(FEB);}
|
720 |
|
|
if(SubDet==3){ FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HO"); FEB_Temp->addDaughter(FEB);}
|
721 |
|
|
if(SubDet==4){ FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HF"); FEB_Temp->addDaughter(FEB);}
|
722 |
|
|
}
|
723 |
querten |
1.34 |
|
724 |
|
|
HcalDetId detid = HcalDetId(Detid);
|
725 |
|
|
|
726 |
|
|
Frog_DetId += ((detid.zside()==1)+1)*10000;
|
727 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
728 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
729 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
|
730 |
querten |
1.34 |
|
731 |
|
|
Frog_DetId += detid.ietaAbs()*100;
|
732 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
733 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
734 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IEta%+i", detid.ieta()); FEB_Temp->addDaughter(FEB);}
|
735 |
querten |
1.34 |
|
736 |
|
|
Frog_DetId += detid.iphi()*1;
|
737 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
738 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
739 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IPhi%i", detid.iphi()); FEB_Temp->addDaughter(FEB);}
|
740 |
querten |
1.22 |
|
741 |
querten |
1.34 |
}else if(Detid.det() == DetId::Calo){
|
742 |
querten |
1.22 |
|
743 |
querten |
1.34 |
Frog_DetId = DETID_CALO;
|
744 |
|
|
FEB = calo;
|
745 |
querten |
1.22 |
|
746 |
querten |
1.34 |
if(SubDet!=(unsigned int)CaloTowerDetId::SubdetId)continue;
|
747 |
querten |
1.22 |
|
748 |
querten |
1.34 |
Frog_DetId += SubDet*100000;
|
749 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
750 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
751 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "CaloTowers"); FEB_Temp->addDaughter(FEB);}
|
752 |
querten |
1.34 |
|
753 |
|
|
if(SubDet==(unsigned int)CaloTowerDetId::SubdetId){
|
754 |
|
|
CaloTowerDetId detid = CaloTowerDetId(Detid);
|
755 |
|
|
|
756 |
|
|
Frog_DetId += ((detid.zside()==1)+1)*10000;
|
757 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
758 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
759 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
|
760 |
querten |
1.34 |
|
761 |
|
|
Frog_DetId += (detid.ieta()*detid.zside())*100;
|
762 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
763 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
764 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IEta%+i", detid.ieta()); FEB_Temp->addDaughter(FEB);}
|
765 |
querten |
1.34 |
|
766 |
|
|
Frog_DetId += detid.iphi()*1;
|
767 |
querten |
1.41 |
FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
|
768 |
querten |
1.34 |
FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
|
769 |
querten |
1.41 |
if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IPhi%i", detid.iphi()); FEB_Temp->addDaughter(FEB);}
|
770 |
querten |
1.34 |
}
|
771 |
querten |
1.35 |
}
|
772 |
querten |
1.22 |
|
773 |
querten |
1.34 |
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid);
|
774 |
|
|
GlobalPoint CellPos = CellGeom->getPosition();
|
775 |
|
|
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners();
|
776 |
|
|
|
777 |
|
|
float cX = (CellCorners[0].x() + CellCorners[2].x())/2;
|
778 |
|
|
float cY = (CellCorners[0].y() + CellCorners[2].y())/2;
|
779 |
|
|
float cZ = (CellCorners[0].z() + CellCorners[2].z())/2;
|
780 |
|
|
|
781 |
|
|
float wX = (CellCorners[1].x() - CellCorners[0].x())/2;
|
782 |
|
|
float wY = (CellCorners[1].y() - CellCorners[0].y())/2;
|
783 |
|
|
float wZ = (CellCorners[1].z() - CellCorners[0].z())/2;
|
784 |
|
|
|
785 |
|
|
float hX = (CellCorners[3].x() - CellCorners[0].x())/2;
|
786 |
|
|
float hY = (CellCorners[3].y() - CellCorners[0].y())/2;
|
787 |
|
|
float hZ = (CellCorners[3].z() - CellCorners[0].z())/2;
|
788 |
|
|
|
789 |
|
|
float F = sqrt( pow(CellCorners[4].x()+CellCorners[6].x(),2) + pow(CellCorners[4].y()+CellCorners[6].y(),2) + pow(CellCorners[4].z()+CellCorners[6].z(),2) );
|
790 |
|
|
F /= sqrt( pow(CellCorners[0].x()+CellCorners[2].x(),2) + pow(CellCorners[0].y()+CellCorners[2].y(),2) + pow(CellCorners[0].z()+CellCorners[2].z(),2) );
|
791 |
|
|
|
792 |
|
|
FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod(
|
793 |
|
|
Detid.rawId(), F,
|
794 |
|
|
cX , cY , cZ ,
|
795 |
|
|
wX , wY , wZ ,
|
796 |
|
|
hX , hY , hZ );
|
797 |
querten |
1.22 |
|
798 |
querten |
1.34 |
FEB->addDaughter(mod);
|
799 |
querten |
1.11 |
}
|
800 |
|
|
|
801 |
querten |
1.22 |
// ### Save .geom ###
|
802 |
querten |
1.11 |
|
803 |
querten |
1.22 |
FROG_Geometry* CMS_Geom = new FROG_Geometry(prim);
|
804 |
|
|
CMS_Geom->Save("CMS.geom");
|
805 |
querten |
1.43 |
delete CMS_Geom;
|
806 |
querten |
1.11 |
}
|
807 |
|
|
|
808 |
querten |
1.15 |
events_prim = new FROG_Element_Base(C_PRIMARY);
|
809 |
querten |
1.1 |
}
|
810 |
|
|
|
811 |
|
|
// ------------ method called once each job just after ending the event loop ------------
|
812 |
|
|
void
|
813 |
roberfro |
1.13 |
Frog_Analyzer::endJob()
|
814 |
querten |
1.22 |
{
|
815 |
|
|
if(NEvents>0){
|
816 |
|
|
char OutputFileName[1024];
|
817 |
|
|
sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str());
|
818 |
querten |
1.43 |
if(NEventsInVisFile>=0)sprintf(OutputFileName,"%s_Run%i_1stEvent%i",OutputFileName,SRun,SEvent);
|
819 |
querten |
1.22 |
sprintf(OutputFileName,"%s.vis",OutputFileName);
|
820 |
|
|
|
821 |
|
|
FROG_Events* events = new FROG_Events(events_prim);
|
822 |
|
|
events->Save((char*) OutputFileName);
|
823 |
|
|
delete events;
|
824 |
|
|
delete events_prim;
|
825 |
|
|
|
826 |
|
|
events_prim = new FROG_Element_Base(C_PRIMARY);
|
827 |
|
|
NEvents=0;
|
828 |
|
|
}
|
829 |
querten |
1.1 |
}
|
830 |
|
|
|
831 |
|
|
|
832 |
|
|
|
833 |
|
|
//
|
834 |
|
|
// member functions
|
835 |
|
|
//
|
836 |
|
|
|
837 |
|
|
// ------------ method called to for each event ------------
|
838 |
|
|
void
|
839 |
|
|
Frog_Analyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup)
|
840 |
|
|
{
|
841 |
querten |
1.22 |
if(NEvents == 0){
|
842 |
|
|
SRun = iEvent.id().run();
|
843 |
|
|
SEvent = iEvent.id().event();
|
844 |
|
|
}
|
845 |
|
|
|
846 |
|
|
|
847 |
querten |
1.26 |
FROG_Element_Event* event = new FROG_Element_Event(iEvent.id().run(), iEvent.id().event(), iEvent.time().value() );
|
848 |
querten |
1.15 |
events_prim->addDaughter(event);
|
849 |
querten |
1.1 |
|
850 |
querten |
1.2 |
// access the tracker
|
851 |
|
|
edm::ESHandle<TrackerGeometry> tkGeom;
|
852 |
|
|
iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom );
|
853 |
querten |
1.1 |
|
854 |
querten |
1.2 |
edm::ESHandle<DTGeometry> DtGeom;
|
855 |
|
|
iSetup.get<MuonGeometryRecord>().get( DtGeom );
|
856 |
|
|
|
857 |
|
|
edm::ESHandle<CSCGeometry> CscGeom;
|
858 |
|
|
iSetup.get<MuonGeometryRecord>().get( CscGeom );
|
859 |
querten |
1.1 |
|
860 |
querten |
1.2 |
edm::ESHandle<RPCGeometry> RpcGeom;
|
861 |
|
|
iSetup.get<MuonGeometryRecord>().get( RpcGeom );
|
862 |
querten |
1.1 |
|
863 |
querten |
1.25 |
edm::ESHandle<CaloGeometry> CaloGeom;
|
864 |
querten |
1.36 |
iSetup.get<CaloGeometryRecord>().get( CaloGeom );
|
865 |
|
|
|
866 |
|
|
|
867 |
querten |
1.41 |
// ### GEN OBJECTS CONTAINER ###
|
868 |
|
|
FROG_Element_Base_With_DetId_And_Name* frogGen = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN, "GEN");
|
869 |
querten |
1.36 |
event->addDaughter(frogGen);
|
870 |
|
|
|
871 |
querten |
1.41 |
// ### GENPARTICLES ###
|
872 |
|
|
FROG_Element_Base_With_DetId_And_Name* frogGenPartColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN_CAND, "GenParticles");
|
873 |
querten |
1.36 |
frogGen->addDaughter(frogGenPartColl);
|
874 |
|
|
|
875 |
querten |
1.40 |
|
876 |
|
|
for(unsigned int i=0;i<GenParticlesProducers.size();i++){
|
877 |
|
|
edm::Handle<GenParticleCollection> h_gen_Particles;
|
878 |
|
|
iEvent.getByLabel(GenParticlesProducers[i], h_gen_Particles);
|
879 |
|
|
GenParticleCollection gen_Particles = *h_gen_Particles.product();
|
880 |
|
|
|
881 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogGenPartCollb = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN_CAND + i + 1, GenParticlesProducers[i].encode().c_str());
|
882 |
querten |
1.40 |
frogGenPartColl->addDaughter(frogGenPartCollb);
|
883 |
|
|
|
884 |
|
|
for(unsigned int h=0;h<gen_Particles.size();h++){
|
885 |
|
|
if(gen_Particles[h].status()!=1)continue;
|
886 |
querten |
1.36 |
FROG_Element_Event_Candidate* frogGenPart = new FROG_Element_Event_Candidate(gen_Particles[h].pdgId(), gen_Particles[h].p(), gen_Particles[h].eta(), gen_Particles[h].phi());
|
887 |
querten |
1.40 |
frogGenPartCollb->addDaughter(frogGenPart);
|
888 |
|
|
}
|
889 |
querten |
1.36 |
}
|
890 |
|
|
|
891 |
|
|
|
892 |
querten |
1.41 |
// ### SIM OBJECTS CONTAINER ###
|
893 |
querten |
1.42 |
FROG_Element_Base_With_DetId_And_Name* frogSim = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIM, "SIM");
|
894 |
querten |
1.41 |
event->addDaughter(frogSim);
|
895 |
querten |
1.25 |
|
896 |
querten |
1.2 |
// ### SIMTRACK ###
|
897 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogSimTrkColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMTRK, "SimTracks");
|
898 |
|
|
frogSim->addDaughter(frogSimTrkColl);
|
899 |
querten |
1.25 |
|
900 |
querten |
1.1 |
for(unsigned int i=0;i<SimTrackProducers.size();i++){
|
901 |
|
|
edm::Handle<std::vector< SimTrack > > h_SimTracks;
|
902 |
|
|
iEvent.getByLabel(SimTrackProducers[i], h_SimTracks);
|
903 |
|
|
std::vector< SimTrack > SimTrackColl = *h_SimTracks.product();
|
904 |
|
|
|
905 |
|
|
for ( unsigned int a = 0; a < SimTrackColl.size(); ++a ) {
|
906 |
|
|
SimTrack simTrack =SimTrackColl[a];
|
907 |
|
|
|
908 |
roberfro |
1.13 |
FROG_Element_Event_Sim_Track* frogSimTrk = new FROG_Element_Event_Sim_Track(simTrack.trackId(),
|
909 |
|
|
simTrack.momentum().x(), simTrack.momentum().y(), simTrack.momentum().z(),
|
910 |
|
|
simTrack.momentum().e(), simTrack.type(), simTrack.vertIndex(),
|
911 |
|
|
simTrack.charge() );
|
912 |
querten |
1.15 |
frogSimTrkColl->addDaughter(frogSimTrk);
|
913 |
querten |
1.1 |
}
|
914 |
|
|
}
|
915 |
|
|
|
916 |
querten |
1.2 |
// ### SIMVERTEX ###
|
917 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogSimVtx = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMVTX, "SimVertex");
|
918 |
|
|
frogSim->addDaughter(frogSimVtx);
|
919 |
querten |
1.25 |
|
920 |
querten |
1.1 |
for(unsigned int i=0;i<SimVertexProducers.size();i++){
|
921 |
|
|
edm::Handle<std::vector< SimVertex > > h_Vertex;
|
922 |
|
|
iEvent.getByLabel(SimVertexProducers[i], h_Vertex);
|
923 |
|
|
std::vector< SimVertex > VertexColl = *h_Vertex.product();
|
924 |
|
|
|
925 |
|
|
for (unsigned int b = 0; b < VertexColl.size(); ++b ) {
|
926 |
|
|
SimVertex Vertex = VertexColl[b];
|
927 |
|
|
|
928 |
querten |
1.25 |
FROG_Element_Event_Sim_Vertex* frogSimVertex = new FROG_Element_Event_Sim_Vertex(
|
929 |
roberfro |
1.13 |
Vertex.position().x(), Vertex.position().y(), Vertex.position().z(),
|
930 |
|
|
Vertex.parentIndex());
|
931 |
querten |
1.1 |
|
932 |
querten |
1.25 |
frogSimVtx->addDaughter(frogSimVertex);
|
933 |
querten |
1.1 |
}
|
934 |
|
|
}
|
935 |
|
|
|
936 |
roberfro |
1.13 |
|
937 |
querten |
1.2 |
// ### SIMHIT ###
|
938 |
querten |
1.15 |
|
939 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogSimHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMHIT, "SimHits");
|
940 |
|
|
frogSim->addDaughter(frogSimHit);
|
941 |
querten |
1.1 |
for(unsigned int i=0;i<SimHitProducers.size();i++){
|
942 |
|
|
edm::Handle<std::vector< PSimHit > > h_Hits;
|
943 |
|
|
iEvent.getByLabel(SimHitProducers[i], h_Hits);
|
944 |
|
|
std::vector< PSimHit > Hits = *h_Hits.product();
|
945 |
|
|
|
946 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogSimHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMHIT + i + 1, SimHitProducers[i].encode().c_str() );
|
947 |
querten |
1.25 |
frogSimHit->addDaughter(frogSimHitColl);
|
948 |
querten |
1.15 |
|
949 |
querten |
1.1 |
for(unsigned int h=0; h<Hits.size(); h++)
|
950 |
|
|
{
|
951 |
querten |
1.2 |
DetId theDetUnitId(Hits[h].detUnitId());
|
952 |
querten |
1.25 |
const GeomDet* theDet = NULL;
|
953 |
|
|
if(theDetUnitId.det() == DetId::Tracker)theDet = tkGeom->idToDet(theDetUnitId);
|
954 |
|
|
if(theDetUnitId.det() == DetId::Muon && theDetUnitId.subdetId() == MuonSubdetId::DT) theDet = DtGeom->idToDet(theDetUnitId);
|
955 |
|
|
if(theDetUnitId.det() == DetId::Muon && theDetUnitId.subdetId() == MuonSubdetId::CSC)theDet = CscGeom->idToDet(theDetUnitId);
|
956 |
|
|
if(theDetUnitId.det() == DetId::Muon && theDetUnitId.subdetId() == MuonSubdetId::RPC)theDet = RpcGeom->idToDet(theDetUnitId);
|
957 |
querten |
1.1 |
|
958 |
querten |
1.15 |
|
959 |
|
|
FROG_Element_Event_Sim_Hit* frogSimHit = new FROG_Element_Event_Sim_Hit(
|
960 |
|
|
theDet->surface().toGlobal(Hits[h].localPosition()).x(),theDet->surface().toGlobal(Hits[h].localPosition()).y(),theDet->surface().toGlobal(Hits[h].localPosition()).z(),
|
961 |
|
|
Hits[h].energyLoss(), Hits[h].processType() );
|
962 |
|
|
frogSimHitColl->addDaughter(frogSimHit);
|
963 |
querten |
1.1 |
}
|
964 |
|
|
}
|
965 |
querten |
1.15 |
|
966 |
querten |
1.25 |
// ### SIMCALOHIT ###
|
967 |
|
|
|
968 |
|
|
for(unsigned int i=0;i<SimCaloHitProducers.size();i++){
|
969 |
|
|
edm::Handle<std::vector< PCaloHit > > h_CaloHits;
|
970 |
|
|
iEvent.getByLabel(SimCaloHitProducers[i], h_CaloHits);
|
971 |
|
|
std::vector< PCaloHit > CaloHits = *h_CaloHits.product();
|
972 |
|
|
|
973 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogSimHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMHIT + SimHitProducers.size() + i + 1, SimCaloHitProducers[i].encode().c_str());
|
974 |
querten |
1.25 |
frogSimHit->addDaughter(frogSimHitColl);
|
975 |
|
|
|
976 |
|
|
for(unsigned int h=0; h<CaloHits.size(); h++)
|
977 |
|
|
{
|
978 |
|
|
DetId theDetUnitId(CaloHits[h].id());
|
979 |
|
|
const CaloCellGeometry* CellGeom = NULL;
|
980 |
|
|
if(theDetUnitId.det() == DetId::Ecal || theDetUnitId.det() == DetId::Hcal)CellGeom = CaloGeom->getGeometry(theDetUnitId);
|
981 |
|
|
if(CellGeom==NULL)continue;
|
982 |
|
|
|
983 |
|
|
|
984 |
|
|
FROG_Element_Event_Sim_Hit* frogSimCaloHit = new FROG_Element_Event_Sim_Hit(
|
985 |
|
|
CellGeom->getPosition().x(),CellGeom->getPosition().y(),CellGeom->getPosition().z(),
|
986 |
|
|
CaloHits[h].energy(), CaloHits[h].depth() );
|
987 |
|
|
frogSimHitColl->addDaughter(frogSimCaloHit);
|
988 |
|
|
}
|
989 |
|
|
}
|
990 |
|
|
|
991 |
querten |
1.9 |
|
992 |
querten |
1.15 |
|
993 |
|
|
|
994 |
querten |
1.41 |
// ### LOW RECO OBJECTS CONTAINER ###
|
995 |
querten |
1.42 |
FROG_Element_Base_With_DetId_And_Name* frogLowReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_LOWRECO, "RECO LOW");
|
996 |
querten |
1.41 |
event->addDaughter(frogLowReco);
|
997 |
querten |
1.40 |
|
998 |
querten |
1.9 |
|
999 |
|
|
|
1000 |
querten |
1.37 |
// ### SiStrip Clusters ###
|
1001 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogSSTHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_SISTRIPHIT, "SiStrip Clusters");
|
1002 |
|
|
frogLowReco->addDaughter(frogSSTHit);
|
1003 |
querten |
1.37 |
for(unsigned int i=0;i<SiStripClusterProducers.size();i++){
|
1004 |
|
|
edm::Handle<edmNew::DetSetVector<SiStripCluster> > h_Sst_Hits;
|
1005 |
|
|
iEvent.getByLabel(SiStripClusterProducers[i], h_Sst_Hits);
|
1006 |
|
|
const edmNew::DetSetVector<SiStripCluster>& Sst_Hits = *h_Sst_Hits.product();
|
1007 |
|
|
|
1008 |
|
|
|
1009 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogSstHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_SISTRIPHIT + i + 1, SiStripClusterProducers[i].encode().c_str());
|
1010 |
querten |
1.37 |
frogSSTHit->addDaughter(frogSstHitColl);
|
1011 |
|
|
|
1012 |
querten |
1.39 |
|
1013 |
|
|
for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter = Sst_Hits.begin(); DSViter != Sst_Hits.end(); ++DSViter) {
|
1014 |
|
|
edmNew::DetSet<SiStripCluster>::const_iterator begin=DSViter->begin();
|
1015 |
querten |
1.37 |
edmNew::DetSet<SiStripCluster>::const_iterator end =DSViter->end();
|
1016 |
querten |
1.39 |
for(edmNew::DetSet<SiStripCluster>::const_iterator iCluster=begin;iCluster!=end;++iCluster){
|
1017 |
querten |
1.37 |
|
1018 |
querten |
1.39 |
const GeomDetUnit* detUnit = tkGeom->idToDetUnit (DetId( iCluster->geographicalId() ) );
|
1019 |
|
|
if(!detUnit)continue;
|
1020 |
querten |
1.37 |
|
1021 |
|
|
const StripGeomDetUnit* DetUnit = dynamic_cast<const StripGeomDetUnit*> ( detUnit );
|
1022 |
|
|
if(!DetUnit)continue;
|
1023 |
|
|
|
1024 |
querten |
1.39 |
const StripTopology& Topo = DetUnit->specificTopology();
|
1025 |
querten |
1.37 |
|
1026 |
|
|
unsigned int Charge = 0;
|
1027 |
querten |
1.39 |
for(unsigned int i=0;i<iCluster->amplitudes().size();i++){Charge+=iCluster->amplitudes()[i];}
|
1028 |
|
|
|
1029 |
|
|
unsigned int MiddleStrip = iCluster->firstStrip() + iCluster->amplitudes().size()/2;
|
1030 |
querten |
1.37 |
|
1031 |
querten |
1.39 |
float Pitch = DetUnit->surface().bounds().width() / Topo.nstrips();
|
1032 |
|
|
float XPos = (MiddleStrip * Pitch) - DetUnit->surface().bounds().width()/2;
|
1033 |
|
|
//float YPos = DetUnit->surface().bounds().thickness()/2;
|
1034 |
|
|
//float ZPos = DetUnit->surface().bounds().length()/2;
|
1035 |
querten |
1.37 |
|
1036 |
|
|
Surface::GlobalPoint Pos = DetUnit->surface().toGlobal( LocalPoint(XPos, 0, 0) );
|
1037 |
|
|
|
1038 |
|
|
|
1039 |
querten |
1.39 |
FROG_Element_Event_Hit_SiStrip* frogStripHit = new FROG_Element_Event_Hit_SiStrip(iCluster->geographicalId(), iCluster->firstStrip(), Pitch);
|
1040 |
|
|
for(unsigned int i=0;i<iCluster->amplitudes().size();i++){frogStripHit->Ampl_.push_back(iCluster->amplitudes()[i]);}
|
1041 |
querten |
1.37 |
frogSstHitColl->addDaughter(frogStripHit);
|
1042 |
|
|
}}
|
1043 |
|
|
|
1044 |
|
|
}
|
1045 |
|
|
|
1046 |
|
|
|
1047 |
|
|
|
1048 |
querten |
1.35 |
// ### CALORecHits ###
|
1049 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogCaloHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_CALOHIT, "CALO Hits");
|
1050 |
|
|
frogLowReco->addDaughter(frogCaloHit);
|
1051 |
querten |
1.35 |
|
1052 |
|
|
|
1053 |
querten |
1.2 |
// ### ECALRecHits ###
|
1054 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogEcalHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_ECALHIT, "ECAL RecHits");
|
1055 |
querten |
1.35 |
frogCaloHit->addDaughter(frogEcalHit);
|
1056 |
querten |
1.1 |
for(unsigned int i=0;i<EcalRecHitProducers.size();i++){
|
1057 |
|
|
edm::Handle<EcalRecHitCollection > h_Ecal_RecHits;
|
1058 |
|
|
iEvent.getByLabel(EcalRecHitProducers[i], h_Ecal_RecHits);
|
1059 |
|
|
EcalRecHitCollection Ecal_RecHits = *h_Ecal_RecHits.product();
|
1060 |
|
|
|
1061 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_ECALHIT + i + 1, EcalRecHitProducers[i].encode().c_str());
|
1062 |
querten |
1.25 |
frogEcalHit->addDaughter(frogHitColl);
|
1063 |
querten |
1.15 |
|
1064 |
querten |
1.1 |
for(unsigned int eh=0;eh<Ecal_RecHits.size();eh++){
|
1065 |
roberfro |
1.14 |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((Ecal_RecHits[eh].detid()).rawId(),
|
1066 |
|
|
Ecal_RecHits[eh].energy(), Ecal_RecHits[eh].time());
|
1067 |
querten |
1.15 |
frogHitColl->addDaughter(frogCaloHit);
|
1068 |
querten |
1.1 |
}
|
1069 |
|
|
}
|
1070 |
|
|
|
1071 |
|
|
|
1072 |
querten |
1.2 |
// ### HCALRecHits ###
|
1073 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogHcalHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_HCALHIT, "HCAL RecHits");
|
1074 |
querten |
1.35 |
frogCaloHit->addDaughter(frogHcalHit);
|
1075 |
querten |
1.1 |
for(unsigned int i=0;i<HcalHBHERecHitProducers.size();i++){
|
1076 |
|
|
edm::Handle<HBHERecHitCollection > h_HcalHBHE_RecHits;
|
1077 |
|
|
iEvent.getByLabel(HcalHBHERecHitProducers[i], h_HcalHBHE_RecHits);
|
1078 |
|
|
HBHERecHitCollection HcalHBHE_RecHits = *h_HcalHBHE_RecHits.product();
|
1079 |
|
|
|
1080 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_HCALHIT + i + 1, HcalHBHERecHitProducers[i].encode().c_str());
|
1081 |
querten |
1.25 |
frogHcalHit->addDaughter(frogHitColl);
|
1082 |
querten |
1.15 |
|
1083 |
querten |
1.1 |
for(unsigned int hh=0;hh<HcalHBHE_RecHits.size();hh++){
|
1084 |
roberfro |
1.14 |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHBHE_RecHits[hh].detid()).rawId(),
|
1085 |
|
|
HcalHBHE_RecHits[hh].energy(), HcalHBHE_RecHits[hh].time());
|
1086 |
querten |
1.15 |
frogHitColl->addDaughter(frogCaloHit);
|
1087 |
querten |
1.1 |
}
|
1088 |
|
|
}
|
1089 |
|
|
|
1090 |
|
|
for(unsigned int i=0;i<HcalHORecHitProducers.size();i++){
|
1091 |
|
|
edm::Handle<HORecHitCollection > h_HcalHO_RecHits;
|
1092 |
|
|
iEvent.getByLabel(HcalHORecHitProducers[i], h_HcalHO_RecHits);
|
1093 |
|
|
HORecHitCollection HcalHO_RecHits = *h_HcalHO_RecHits.product();
|
1094 |
|
|
|
1095 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_HCALHIT + HcalHBHERecHitProducers.size() + i + 1, HcalHORecHitProducers[i].encode().c_str());
|
1096 |
querten |
1.25 |
frogHcalHit->addDaughter(frogHitColl);
|
1097 |
querten |
1.15 |
|
1098 |
querten |
1.1 |
for(unsigned int hh=0;hh<HcalHO_RecHits.size();hh++){
|
1099 |
querten |
1.15 |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHO_RecHits[hh].detid()).rawId(),
|
1100 |
|
|
HcalHO_RecHits[hh].energy(), HcalHO_RecHits[hh].time());
|
1101 |
|
|
frogHitColl->addDaughter(frogCaloHit);
|
1102 |
querten |
1.1 |
}
|
1103 |
|
|
}
|
1104 |
|
|
|
1105 |
|
|
for(unsigned int i=0;i<HcalHFRecHitProducers.size();i++){
|
1106 |
|
|
edm::Handle<HFRecHitCollection > h_HcalHF_RecHits;
|
1107 |
|
|
iEvent.getByLabel(HcalHFRecHitProducers[i], h_HcalHF_RecHits);
|
1108 |
|
|
HFRecHitCollection HcalHF_RecHits = *h_HcalHF_RecHits.product();
|
1109 |
|
|
|
1110 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_HCALHIT + HcalHBHERecHitProducers.size() + HcalHORecHitProducers.size() + i + 1, HcalHFRecHitProducers[i].encode().c_str());
|
1111 |
querten |
1.25 |
frogHcalHit->addDaughter(frogHitColl);
|
1112 |
querten |
1.15 |
|
1113 |
querten |
1.1 |
for(unsigned int hh=0;hh<HcalHF_RecHits.size();hh++){
|
1114 |
querten |
1.15 |
FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHF_RecHits[hh].detid()).rawId(),
|
1115 |
|
|
HcalHF_RecHits[hh].energy(), HcalHF_RecHits[hh].time());
|
1116 |
|
|
frogHitColl->addDaughter(frogCaloHit);
|
1117 |
querten |
1.1 |
}
|
1118 |
|
|
}
|
1119 |
|
|
|
1120 |
querten |
1.25 |
|
1121 |
querten |
1.2 |
// ### Muon Segments ###
|
1122 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogMuonSeg = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONSEG, "MuonSegments");
|
1123 |
|
|
frogLowReco->addDaughter(frogMuonSeg);
|
1124 |
querten |
1.25 |
|
1125 |
querten |
1.2 |
for(unsigned int i=0;i<CSCSegmentProducers.size();i++){
|
1126 |
|
|
edm::Handle<CSCSegmentCollection > h_CSC_Segments;
|
1127 |
|
|
iEvent.getByLabel(CSCSegmentProducers[i], h_CSC_Segments);
|
1128 |
|
|
CSCSegmentCollection CSC_Segments = *h_CSC_Segments.product();
|
1129 |
|
|
|
1130 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogSegColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONSEG + i + 1, CSCSegmentProducers[i].encode().c_str());
|
1131 |
querten |
1.25 |
frogMuonSeg->addDaughter(frogSegColl);
|
1132 |
querten |
1.15 |
|
1133 |
querten |
1.2 |
for(unsigned int s=0;s<CSC_Segments.size();s++){
|
1134 |
|
|
DetId theDetUnitId = CSC_Segments[s].geographicalId();
|
1135 |
|
|
const GeomDet* theDet = CscGeom->idToDet(theDetUnitId);
|
1136 |
|
|
|
1137 |
querten |
1.15 |
FROG_Element_Event_Segment* frogSeg = new FROG_Element_Event_Segment(theDetUnitId.rawId(),
|
1138 |
|
|
theDet->surface().toGlobal(CSC_Segments[s].localPosition()).x() , theDet->surface().toGlobal(CSC_Segments[s].localPosition()).y() , theDet->surface().toGlobal(CSC_Segments[s].localPosition()).z() ,
|
1139 |
|
|
theDet->surface().toGlobal(CSC_Segments[s].localDirection()).x(), theDet->surface().toGlobal(CSC_Segments[s].localDirection()).y(), theDet->surface().toGlobal(CSC_Segments[s].localDirection()).z() );
|
1140 |
|
|
frogSegColl->addDaughter(frogSeg);
|
1141 |
querten |
1.2 |
}
|
1142 |
|
|
}
|
1143 |
|
|
|
1144 |
|
|
for(unsigned int i=0;i<DTSegmentProducers.size();i++){
|
1145 |
|
|
edm::Handle<DTRecSegment4DCollection > h_DT_Segments;
|
1146 |
|
|
iEvent.getByLabel(DTSegmentProducers[i], h_DT_Segments);
|
1147 |
|
|
DTRecSegment4DCollection DT_Segments = *h_DT_Segments.product();
|
1148 |
|
|
|
1149 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogSegColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONSEG + CSCSegmentProducers.size() + i + 1, DTSegmentProducers[i].encode().c_str());
|
1150 |
querten |
1.25 |
frogMuonSeg->addDaughter(frogSegColl);
|
1151 |
querten |
1.15 |
|
1152 |
querten |
1.2 |
for(unsigned int s=0;s<DT_Segments.size();s++){
|
1153 |
|
|
DetId theDetUnitId = DT_Segments[s].geographicalId();
|
1154 |
|
|
const GeomDet* theDet = DtGeom->idToDet(theDetUnitId);
|
1155 |
|
|
|
1156 |
querten |
1.15 |
FROG_Element_Event_Segment* frogSeg = new FROG_Element_Event_Segment(theDetUnitId.rawId(),
|
1157 |
|
|
theDet->surface().toGlobal(DT_Segments[s].localPosition()).x() , theDet->surface().toGlobal(DT_Segments[s].localPosition()).y() , theDet->surface().toGlobal(DT_Segments[s].localPosition()).z() ,
|
1158 |
|
|
theDet->surface().toGlobal(DT_Segments[s].localDirection()).x(), theDet->surface().toGlobal(DT_Segments[s].localDirection()).y(), theDet->surface().toGlobal(DT_Segments[s].localDirection()).z() );
|
1159 |
|
|
frogSegColl->addDaughter(frogSeg);
|
1160 |
querten |
1.2 |
}
|
1161 |
|
|
}
|
1162 |
|
|
|
1163 |
|
|
// ### Muon Hits ###
|
1164 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogMuonHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONHIT, "MuonHits");
|
1165 |
|
|
frogLowReco->addDaughter(frogMuonHit);
|
1166 |
querten |
1.2 |
for(unsigned int i=0;i<RPCHitsProducers.size();i++){
|
1167 |
|
|
edm::Handle<RPCRecHitCollection > h_RPC_Hits;
|
1168 |
|
|
iEvent.getByLabel(RPCHitsProducers[i], h_RPC_Hits);
|
1169 |
|
|
RPCRecHitCollection RPC_Hits = *h_RPC_Hits.product();
|
1170 |
|
|
|
1171 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONHIT + i + 1, RPCHitsProducers[i].encode().c_str());
|
1172 |
querten |
1.25 |
frogMuonHit->addDaughter(frogHitColl);
|
1173 |
querten |
1.15 |
|
1174 |
querten |
1.2 |
for(unsigned int h=0;h<RPC_Hits.size();h++){
|
1175 |
|
|
DetId theDetUnitId = RPC_Hits[h].geographicalId();
|
1176 |
|
|
const GeomDet* theDet = RpcGeom->idToDet(theDetUnitId);
|
1177 |
|
|
|
1178 |
querten |
1.15 |
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(theDetUnitId.rawId(),
|
1179 |
|
|
theDet->surface().toGlobal(RPC_Hits[h].localPosition()).x() , theDet->surface().toGlobal(RPC_Hits[h].localPosition()).y() , theDet->surface().toGlobal(RPC_Hits[h].localPosition()).z(), -1 );
|
1180 |
|
|
frogHitColl->addDaughter(frogHit);
|
1181 |
querten |
1.2 |
}
|
1182 |
|
|
}
|
1183 |
|
|
|
1184 |
querten |
1.25 |
|
1185 |
querten |
1.35 |
// ### Calo Towers ###
|
1186 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogCaloTower = new FROG_Element_Base_With_DetId_And_Name( EVTID_CALOTOWER, "CaloTowers");
|
1187 |
|
|
frogLowReco->addDaughter(frogCaloTower);
|
1188 |
querten |
1.35 |
for(unsigned int i=0;i<CaloTowersProducers.size();i++){
|
1189 |
|
|
edm::Handle<CaloTowerCollection> h_Calo_Towers;
|
1190 |
|
|
iEvent.getByLabel(CaloTowersProducers[i], h_Calo_Towers);
|
1191 |
|
|
CaloTowerCollection Calo_Towers = *h_Calo_Towers.product();
|
1192 |
|
|
|
1193 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogCaloTowerColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_CALOTOWER + i + 1, CaloTowersProducers[i].encode().c_str());
|
1194 |
querten |
1.35 |
frogCaloTower->addDaughter(frogCaloTowerColl);
|
1195 |
|
|
|
1196 |
|
|
for(unsigned int h=0;h<Calo_Towers.size();h++){
|
1197 |
|
|
FROG_Element_Event_CaloTower* frogTower = new FROG_Element_Event_CaloTower(Calo_Towers[h].id().rawId(), Calo_Towers[h].emEnergy(),Calo_Towers[h].hadEnergy());
|
1198 |
|
|
frogCaloTowerColl->addDaughter(frogTower);
|
1199 |
|
|
|
1200 |
|
|
if(i==0 && CaloTowersProducersBasedOnCaloHits){
|
1201 |
|
|
frogTower->Components_CollEvtId_ = EVTID_CALOHIT;
|
1202 |
querten |
1.43 |
|
1203 |
|
|
|
1204 |
|
|
for(unsigned int D=0;D<Calo_Towers[h].constituentsSize();D++){frogTower->Components_Vector_.push_back(Calo_Towers[h].constituent(D));}
|
1205 |
|
|
|
1206 |
|
|
// std::vector<DetId> TowersDetIds = Calo_Towers[h].constituents();
|
1207 |
|
|
// for(unsigned int D=0;D<TowersDetIds.size();D++){frogTower->Components_Vector_.push_back(TowersDetIds[D]);}
|
1208 |
querten |
1.35 |
}
|
1209 |
|
|
|
1210 |
|
|
}
|
1211 |
|
|
}
|
1212 |
|
|
|
1213 |
querten |
1.41 |
|
1214 |
|
|
|
1215 |
|
|
// ### MED RECO OBJECTS CONTAINER ###
|
1216 |
querten |
1.42 |
FROG_Element_Base_With_DetId_And_Name* frogMedReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_MEDRECO, "RECO MED");
|
1217 |
querten |
1.41 |
event->addDaughter(frogMedReco);
|
1218 |
|
|
|
1219 |
|
|
|
1220 |
|
|
|
1221 |
|
|
|
1222 |
|
|
|
1223 |
|
|
FROG_Element_Base_With_DetId_And_Name* frogNIVertex = new FROG_Element_Base_With_DetId_And_Name( EVTID_NUCLINT, "Vertex from NI");
|
1224 |
|
|
frogMedReco->addDaughter(frogNIVertex);
|
1225 |
|
|
|
1226 |
|
|
// NUCLEAR INTERACTIONS
|
1227 |
|
|
for(unsigned int i=0;i<NIProducers.size();i++) {
|
1228 |
|
|
edm::Handle<std::vector<reco::NuclearInteraction> > h_NIs;
|
1229 |
|
|
iEvent.getByLabel(NIProducers[i], h_NIs);
|
1230 |
|
|
std::vector<reco::NuclearInteraction> NIs = *h_NIs.product();
|
1231 |
|
|
FROG_Element_Base_With_DetId_And_Name* frogNIColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_NUCLINT + i + 1, NIProducers[i].encode().c_str());
|
1232 |
|
|
frogNIVertex->addDaughter(frogNIColl);
|
1233 |
|
|
|
1234 |
|
|
for(unsigned int h=0; h<NIs.size();h++){
|
1235 |
|
|
reco::NuclearInteraction ni = NIs[i];
|
1236 |
|
|
float vtx_x = ni.vertex().x();
|
1237 |
|
|
float vtx_y = ni.vertex().y();
|
1238 |
|
|
float vtx_z = ni.vertex().z();
|
1239 |
|
|
float like = ni.likelihood();
|
1240 |
|
|
FROG_Element_Event_NuclInt* frogNI = new FROG_Element_Event_NuclInt(vtx_x, vtx_y, vtx_z, like );
|
1241 |
|
|
frogNIColl->addDaughter(frogNI);
|
1242 |
|
|
}
|
1243 |
|
|
}
|
1244 |
|
|
|
1245 |
|
|
|
1246 |
|
|
|
1247 |
|
|
// ### TRAJECTORY ###
|
1248 |
|
|
FROG_Element_Base_With_DetId_And_Name* frogTrk = new FROG_Element_Base_With_DetId_And_Name( EVTID_TRK, "Tracks & Trajectories");
|
1249 |
|
|
frogMedReco->addDaughter(frogTrk);
|
1250 |
|
|
|
1251 |
|
|
for(unsigned int i=0;i<TrajectoryProducers.size();i++){
|
1252 |
|
|
Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle;
|
1253 |
|
|
iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle);
|
1254 |
|
|
const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product();
|
1255 |
|
|
|
1256 |
|
|
FROG_Element_Base_With_DetId_And_Name* frogTrkColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_TRK + i + 1, "Traj | %s", TrajectoryProducers[i].encode().c_str());
|
1257 |
|
|
frogTrk->addDaughter(frogTrkColl);
|
1258 |
|
|
|
1259 |
|
|
for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) {
|
1260 |
|
|
Trajectory recoTraj = *it->key;
|
1261 |
|
|
FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(i,it->val->p(),it->val->pt(),it->key->chiSquared());
|
1262 |
|
|
frogTrkColl->addDaughter(frogTrk);
|
1263 |
|
|
|
1264 |
|
|
std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements();
|
1265 |
|
|
for(unsigned int h=0;h<measurements.size();h++){
|
1266 |
|
|
|
1267 |
|
|
TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit();
|
1268 |
|
|
if(!h_it->isValid() )continue;
|
1269 |
|
|
DetId detId = h_it->geographicalId();
|
1270 |
|
|
GlobalPoint globalPos = measurements[h].updatedState().globalPosition();
|
1271 |
|
|
|
1272 |
|
|
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(detId.rawId(), globalPos.x(),globalPos.y(), globalPos.z(), -1);
|
1273 |
|
|
frogTrk->addDaughter(frogHit);
|
1274 |
|
|
}
|
1275 |
|
|
// printf("Add a Trajectory\n");
|
1276 |
|
|
}
|
1277 |
|
|
}
|
1278 |
|
|
|
1279 |
|
|
|
1280 |
|
|
|
1281 |
|
|
|
1282 |
|
|
// ### TRACK ###
|
1283 |
|
|
|
1284 |
|
|
for(unsigned int i=0;i<TrackProducers.size();i++){
|
1285 |
|
|
edm::Handle<std::vector< reco::Track > > h_Tracks;
|
1286 |
|
|
iEvent.getByLabel(TrackProducers[i], h_Tracks);
|
1287 |
|
|
std::vector< reco::Track > TrackColl = *h_Tracks.product();
|
1288 |
|
|
|
1289 |
|
|
FROG_Element_Base_With_DetId_And_Name* frogTrkColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_TRK + TrajectoryProducers.size() + i + 1, "Track | %s", TrackProducers[i].encode().c_str());
|
1290 |
|
|
frogTrk->addDaughter(frogTrkColl);
|
1291 |
|
|
|
1292 |
|
|
//printf("Size of the TrackCOllection : %i = %i\n",i,TrackColl.size());
|
1293 |
|
|
for ( unsigned int t = 0; t < TrackColl.size(); ++t ) {
|
1294 |
|
|
reco::Track recoTrack =TrackColl[t];
|
1295 |
|
|
|
1296 |
|
|
FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(TrajectoryProducers.size()+i,recoTrack.p(),recoTrack.pt(), recoTrack.chi2());
|
1297 |
|
|
frogTrkColl->addDaughter(frogTrk);
|
1298 |
|
|
|
1299 |
|
|
for(unsigned int h=0;h<recoTrack.recHitsSize();h++){
|
1300 |
|
|
TrackingRecHitRef h_it = recoTrack.recHit(h);
|
1301 |
|
|
if(!h_it->isValid() )continue;
|
1302 |
|
|
DetId detId = h_it->geographicalId();
|
1303 |
|
|
const GeomDet * theDet = NULL;
|
1304 |
|
|
|
1305 |
|
|
if(detId.det()==DetId::Tracker) theDet = tkGeom->idToDet(detId);
|
1306 |
|
|
if(detId.det()==DetId::Muon && detId.subdetId() == 1) theDet = DtGeom->idToDet(detId);
|
1307 |
|
|
if(detId.det()==DetId::Muon && detId.subdetId() == 2) theDet = CscGeom->idToDet(detId);
|
1308 |
|
|
if(detId.det()==DetId::Muon && detId.subdetId() == 3) theDet = RpcGeom->idToDet(detId);
|
1309 |
|
|
|
1310 |
|
|
LocalPoint localPos = h_it->localPosition();
|
1311 |
|
|
|
1312 |
|
|
FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(
|
1313 |
|
|
detId.rawId(),
|
1314 |
|
|
theDet->surface().toGlobal(localPos).x(),
|
1315 |
|
|
theDet->surface().toGlobal(localPos).y(),
|
1316 |
|
|
theDet->surface().toGlobal(localPos).z(),
|
1317 |
|
|
-1);
|
1318 |
|
|
frogTrk->addDaughter(frogHit);
|
1319 |
|
|
}
|
1320 |
|
|
//printf("Add a Track\n");
|
1321 |
|
|
|
1322 |
|
|
}
|
1323 |
|
|
}
|
1324 |
|
|
|
1325 |
|
|
|
1326 |
|
|
|
1327 |
|
|
|
1328 |
|
|
|
1329 |
|
|
|
1330 |
|
|
// ### HIGH RECO OBJECTS CONTAINER ###
|
1331 |
querten |
1.42 |
FROG_Element_Base_With_DetId_And_Name* frogHighReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_HIGHRECO, "RECO HIGH");
|
1332 |
querten |
1.41 |
event->addDaughter(frogHighReco);
|
1333 |
|
|
|
1334 |
|
|
|
1335 |
|
|
|
1336 |
|
|
FROG_Element_Base_With_DetId_And_Name* frogJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET, "Jets");
|
1337 |
|
|
frogHighReco->addDaughter(frogJet);
|
1338 |
querten |
1.35 |
|
1339 |
|
|
|
1340 |
querten |
1.33 |
// ### Basic Jets ###
|
1341 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogBasicJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_BASIC, "BasicJets");
|
1342 |
querten |
1.35 |
frogJet->addDaughter(frogBasicJet);
|
1343 |
querten |
1.33 |
for(unsigned int i=0;i<BasicJetsProducers.size();i++){
|
1344 |
|
|
edm::Handle<BasicJetCollection> h_Basic_Jets;
|
1345 |
|
|
iEvent.getByLabel(BasicJetsProducers[i], h_Basic_Jets);
|
1346 |
|
|
BasicJetCollection Basic_Jets = *h_Basic_Jets.product();
|
1347 |
|
|
|
1348 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogBasicJetColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_BASIC + i + 1, BasicJetsProducers[i].encode().c_str());
|
1349 |
querten |
1.33 |
frogBasicJet->addDaughter(frogBasicJetColl);
|
1350 |
|
|
|
1351 |
|
|
for(unsigned int h=0;h<Basic_Jets.size();h++){
|
1352 |
|
|
FROG_Element_Event_Jet* frogJet = new FROG_Element_Event_Jet(Basic_Jets[h].p(), Basic_Jets[h].eta(),Basic_Jets[h].phi());
|
1353 |
|
|
frogBasicJet->addDaughter(frogJet);
|
1354 |
|
|
}
|
1355 |
|
|
}
|
1356 |
|
|
|
1357 |
querten |
1.28 |
|
1358 |
|
|
// ### Calo Jets ###
|
1359 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogCaloJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_CALO, "CaloJets");
|
1360 |
querten |
1.35 |
frogJet->addDaughter(frogCaloJet);
|
1361 |
querten |
1.28 |
for(unsigned int i=0;i<CaloJetsProducers.size();i++){
|
1362 |
|
|
edm::Handle<CaloJetCollection> h_Calo_Jets;
|
1363 |
|
|
iEvent.getByLabel(CaloJetsProducers[i], h_Calo_Jets);
|
1364 |
|
|
CaloJetCollection Calo_Jets = *h_Calo_Jets.product();
|
1365 |
|
|
|
1366 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogCaloJetColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_CALO + i + 1, CaloJetsProducers[i].encode().c_str());
|
1367 |
querten |
1.28 |
frogCaloJet->addDaughter(frogCaloJetColl);
|
1368 |
|
|
|
1369 |
|
|
for(unsigned int h=0;h<Calo_Jets.size();h++){
|
1370 |
querten |
1.30 |
FROG_Element_Event_Jet* frogJet = new FROG_Element_Event_Jet(Calo_Jets[h].p(), Calo_Jets[h].eta(),Calo_Jets[h].phi());
|
1371 |
querten |
1.35 |
frogCaloJetColl->addDaughter(frogJet);
|
1372 |
querten |
1.32 |
|
1373 |
querten |
1.35 |
if(CaloJetsProducersBasedOnCaloTowers){
|
1374 |
querten |
1.43 |
|
1375 |
|
|
std::vector<CaloTowerPtr> CaloTowers = Calo_Jets[h].getCaloConstituents();
|
1376 |
querten |
1.35 |
frogJet->Components_CollEvtId_ = EVTID_CALOTOWER + 1;
|
1377 |
|
|
for(unsigned int t=0;t<CaloTowers.size();t++){ frogJet->Components_Vector_.push_back(CaloTowers[t]->id().rawId());}
|
1378 |
querten |
1.32 |
}
|
1379 |
querten |
1.28 |
}
|
1380 |
|
|
}
|
1381 |
|
|
|
1382 |
querten |
1.41 |
// ### MET ###
|
1383 |
|
|
FROG_Element_Base_With_DetId_And_Name* frogMET = new FROG_Element_Base_With_DetId_And_Name( EVTID_MET_CALO, "MET");
|
1384 |
|
|
frogHighReco->addDaughter(frogMET);
|
1385 |
|
|
for(unsigned int i=0;i<CaloMETProducers.size();i++){
|
1386 |
|
|
edm::Handle<CaloMETCollection> h_met;
|
1387 |
|
|
iEvent.getByLabel(CaloMETProducers[i], h_met);
|
1388 |
|
|
CaloMETCollection reco_met = *h_met.product();
|
1389 |
|
|
|
1390 |
|
|
FROG_Element_Base_With_DetId_And_Name* frogMETColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_MET_CALO + i + 1, CaloMETProducers[i].encode().c_str());
|
1391 |
|
|
frogMET->addDaughter(frogMETColl);
|
1392 |
|
|
|
1393 |
|
|
for(unsigned int h=0;h<reco_met.size();h++){
|
1394 |
|
|
FROG_Element_Event_MET* frogMETevt = new FROG_Element_Event_MET(i, reco_met[h].p(), reco_met[h].eta(),reco_met[h].phi(), reco_met[h].sumEt());
|
1395 |
|
|
frogMETColl->addDaughter(frogMETevt);
|
1396 |
|
|
}
|
1397 |
|
|
}
|
1398 |
|
|
|
1399 |
|
|
|
1400 |
querten |
1.36 |
// ### RecoCandidates ###
|
1401 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogRecoCand = new FROG_Element_Base_With_DetId_And_Name( EVTID_RECOCAND, "RecoCandidates");
|
1402 |
|
|
frogHighReco->addDaughter(frogRecoCand);
|
1403 |
querten |
1.36 |
for(unsigned int i=0;i<RecoCandidateProducers.size();i++){
|
1404 |
|
|
edm::Handle<CandidateCollection> h_reco_Candidates;
|
1405 |
|
|
iEvent.getByLabel(RecoCandidateProducers[i], h_reco_Candidates);
|
1406 |
|
|
CandidateCollection reco_Candidates = *h_reco_Candidates.product();
|
1407 |
|
|
|
1408 |
querten |
1.41 |
FROG_Element_Base_With_DetId_And_Name* frogRecoCandColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_RECOCAND + i + 1, RecoCandidateProducers[i].encode().c_str());
|
1409 |
querten |
1.36 |
frogRecoCand->addDaughter(frogRecoCandColl);
|
1410 |
|
|
|
1411 |
|
|
for(unsigned int h=0;h<reco_Candidates.size();h++){
|
1412 |
|
|
FROG_Element_Event_Candidate* frogCandidate = new FROG_Element_Event_Candidate(reco_Candidates[h].pdgId(), reco_Candidates[h].p(), reco_Candidates[h].eta(),reco_Candidates[h].phi());
|
1413 |
|
|
frogRecoCandColl->addDaughter(frogCandidate);
|
1414 |
roberfro |
1.29 |
}
|
1415 |
|
|
}
|
1416 |
|
|
|
1417 |
querten |
1.28 |
|
1418 |
|
|
|
1419 |
querten |
1.22 |
NEvents++;
|
1420 |
|
|
if(NEvents == NEventsInVisFile){
|
1421 |
|
|
char OutputFileName[1024];
|
1422 |
|
|
sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str());
|
1423 |
querten |
1.43 |
if(NEventsInVisFile>=0)sprintf(OutputFileName,"%s_Run%i_1stEvent%i",OutputFileName,SRun,SEvent);
|
1424 |
querten |
1.22 |
sprintf(OutputFileName,"%s.vis",OutputFileName);
|
1425 |
|
|
|
1426 |
|
|
FROG_Events* events = new FROG_Events(events_prim);
|
1427 |
|
|
events->Save((char*) OutputFileName);
|
1428 |
|
|
delete events;
|
1429 |
|
|
delete events_prim;
|
1430 |
roberfro |
1.13 |
|
1431 |
querten |
1.22 |
events_prim = new FROG_Element_Base(C_PRIMARY);
|
1432 |
|
|
NEvents=0;
|
1433 |
|
|
}
|
1434 |
querten |
1.15 |
|
1435 |
querten |
1.1 |
}
|
1436 |
|
|
|
1437 |
|
|
|
1438 |
|
|
//define this as a plug-in
|
1439 |
|
|
DEFINE_FWK_MODULE(Frog_Analyzer);
|
1440 |
|
|
|
1441 |
|
|
|