ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/FastOpenGlDisplayer/src/Frog_Analyzer.cc
(Generate patch)

Comparing UserCode/FastOpenGlDisplayer/src/Frog_Analyzer.cc (file contents):
Revision 1.23 by querten, Fri Jul 11 04:38:40 2008 UTC vs.
Revision 1.46 by querten, Tue Oct 21 10:30:49 2008 UTC

# Line 49 | Line 49
49   #include "Geometry/Records/interface/IdealGeometryRecord.h"
50   #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
51   #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
52 < #include "Geometry/EcalBarrelAlgo/interface/EcalBarrelGeometry.h"
53 < #include "Geometry/EcalEndcapAlgo/interface/EcalEndcapGeometry.h"
52 > //#include "Geometry/EcalBarrelAlgo/interface/EcalBarrelGeometry.h"
53 > //#include "Geometry/EcalEndcapAlgo/interface/EcalEndcapGeometry.h"
54 > #include "Geometry/Records/interface/CaloGeometryRecord.h"
55 >
56 > #include "Geometry/EcalAlgo/interface/EcalBarrelGeometry.h"
57 > #include "Geometry/EcalAlgo/interface/EcalEndcapGeometry.h"
58   #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
59   #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
60  
# Line 60 | Line 64
64   #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
65   #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
66  
67 + #include "DataFormats/Common/interface/DetSetVector.h"
68 + #include "DataFormats/Common/interface/DetSetVectorNew.h"
69 +
70 + #include "DataFormats/SiStripCluster/interface/SiStripClusterCollection.h"
71  
72   #include "DataFormats/CaloRecHit/interface/CaloRecHit.h"
73   #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
# Line 82 | Line 90
90   #include "TrackingTools/PatternTools/interface/Trajectory.h"
91   #include "TrackingTools/PatternTools/interface/TrajTrackAssociation.h"
92  
93 + #include "DataFormats/HepMCCandidate/interface/GenParticle.h"
94 +
95  
96   #include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
97   #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
# Line 112 | Line 122
122   #include "DataFormats/EcalDetId/interface/ESDetId.h"
123   #include "DataFormats/HcalDetId/interface/HcalDetId.h"
124  
125 < #include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Base_With_DetId.h"
125 > #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 > #include "DataFormats/METReco/interface/CaloMET.h"
133 > #include "DataFormats/METReco/interface/CaloMETFwd.h"
134 >
135 > #define FROG_ZLIB
136 >
137 > //#include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Base_With_DetId_And_Name.h"
138   #include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Tools.h"
139   #include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Tools.cpp"
140   #include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Event_Track.h"
# Line 125 | Line 147
147  
148   #include "Visualisation/Frog/soft/Includes/FROG/FROG_DetId.h"
149   #include "Visualisation/Frog/soft/Includes/FROG/FROG_ReadCards.cpp"
150 + #include "Visualisation/Frog/soft/Includes/FROG/FROG_Element_Event_NuclInt.h"
151 +
152 + #include "Visualisation/Frog/soft/Includes/FROG/FROG_Coord.h"
153 + #include "Visualisation/Frog/soft/Includes/FROG/FROG_Coord.cpp"
154 +
155 + #include "Visualisation/Frog/soft/Includes/FROG/FROG_ZLib.h"
156 + #include "Visualisation/Frog/soft/Includes/FROG/FROG_ZLib.cpp"
157 +
158  
159  
160   using namespace edm;
161   using namespace std;
162 + using namespace reco;
163  
164   //
165   // class decleration
# Line 145 | Line 176 | class Frog_Analyzer : public edm::EDAnal
176        virtual void analyze (const edm::Event&, const edm::EventSetup&);
177        virtual void endJob  ();
178  
179 +      FROG_Events*          events;
180        FROG_Element_Base*    events_prim;
181  
182        std::string           OutputFile;
183  
184 +      std::vector<InputTag> GenParticlesProducers;
185 +
186        std::vector<InputTag> SimTrackProducers;
187        std::vector<InputTag> SimVertexProducers;
188        std::vector<InputTag> SimHitProducers;
189 +      std::vector<InputTag> SimCaloHitProducers;
190 +
191 +      std::vector<InputTag> NIProducers;
192  
193        std::vector<InputTag> TrackProducers;
194        std::vector<InputTag> TrajectoryProducers;
195 +      std::vector<InputTag> SiStripClusterProducers;
196        std::vector<InputTag> EcalRecHitProducers;
197        std::vector<InputTag> HcalHBHERecHitProducers;
198        std::vector<InputTag> HcalHORecHitProducers;
# Line 164 | Line 202 | class Frog_Analyzer : public edm::EDAnal
202  
203        std::vector<InputTag> RPCHitsProducers;
204  
205 +      std::vector<InputTag> CaloTowersProducers;
206 +      bool                  CaloTowersProducersBasedOnCaloHits;
207 +
208 +      std::vector<InputTag> BasicJetsProducers;
209 +      std::vector<InputTag> CaloJetsProducers;
210 +      bool                  CaloJetsProducersBasedOnCaloTowers;
211 +
212 +      std::vector<InputTag> RecoCandidateProducers;
213 +      std::vector<InputTag> CaloMETProducers;
214 +
215 +
216        // ----------member data ---------------------------
217  
218 +      bool                  CompressFiles;
219 +
220 +
221        bool                  ProduceGeom;
222        int                   NEventsInVisFile;
223        int                   NEvents;
# Line 181 | Line 233 | Frog_Analyzer::Frog_Analyzer(const edm::
233   {
234      OutputFile              = iConfig.getParameter<std::string >("OutputFile");
235  
236 +    GenParticlesProducers   = iConfig.getParameter<std::vector<InputTag> >("GenParticlesProducers");
237 +
238      SimTrackProducers       = iConfig.getParameter<std::vector<InputTag> >("SimTrackProducers");
239      SimVertexProducers      = iConfig.getParameter<std::vector<InputTag> >("SimVertexProducers");
240      SimHitProducers         = iConfig.getParameter<std::vector<InputTag> >("SimHitProducers");
241 +    SimCaloHitProducers     = iConfig.getParameter<std::vector<InputTag> >("SimCaloHitProducers");
242 +
243  
244      TrackProducers          = iConfig.getParameter<std::vector<InputTag> >("TrackProducers");
245      TrajectoryProducers     = iConfig.getParameter<std::vector<InputTag> >("TrajectoryProducers");
246 +    SiStripClusterProducers = iConfig.getParameter<std::vector<InputTag> >("SiStripClusterProducers");
247      EcalRecHitProducers     = iConfig.getParameter<std::vector<InputTag> >("EcalRecHitProducers");
248      HcalHBHERecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHBHERecHitProducers");
249      HcalHORecHitProducers   = iConfig.getParameter<std::vector<InputTag> >("HcalHORecHitProducers");
250      HcalHFRecHitProducers   = iConfig.getParameter<std::vector<InputTag> >("HcalHFRecHitProducers");
251  
252 +    NIProducers             = iConfig.getParameter<std::vector<InputTag> >("NIProducers");
253 +
254      DTSegmentProducers      = iConfig.getParameter<std::vector<InputTag> >("DTSegmentProducers");
255      CSCSegmentProducers     = iConfig.getParameter<std::vector<InputTag> >("CSCSegmentProducers");
256  
257      RPCHitsProducers        = iConfig.getParameter<std::vector<InputTag> >("RPCHitsProducers");
258  
259 +    CaloTowersProducers     = iConfig.getParameter<std::vector<InputTag> >("CaloTowersProducers");
260 +    CaloTowersProducersBasedOnCaloHits = iConfig.getParameter<bool>("CaloTowersProducersBasedOnCaloHits");
261 +
262 +
263 +    BasicJetsProducers      = iConfig.getParameter<std::vector<InputTag> >("BasicJetsProducers");
264 +    CaloJetsProducers       = iConfig.getParameter<std::vector<InputTag> >("CaloJetsProducers");
265 +    CaloJetsProducersBasedOnCaloTowers = iConfig.getParameter<bool>("CaloJetsProducersBasedOnCaloTowers");
266 +
267 +    RecoCandidateProducers  = iConfig.getParameter<std::vector<InputTag> >("RecoCandidateProducers");
268 +    CaloMETProducers        = iConfig.getParameter<std::vector<InputTag> >("CaloMETProducers");
269 +
270      ProduceGeom             = iConfig.getParameter<bool  >("ProduceGeom"       );
271      NEventsInVisFile        = iConfig.getParameter<int   >("NEventsInVisFile"  );
272 +    CompressFiles           = iConfig.getParameter<bool  >("CompressFiles"     );
273 +
274  
275      NEvents = 0;
276   }
# Line 218 | Line 290 | Frog_Analyzer::beginJob(const edm::Event
290  
291        unsigned int Frog_DetId;
292        FROG_Element_Base*            FEB      = NULL;
293 <      FROG_Element_Base_With_DetId* FEB_Temp = NULL;
293 >      FROG_Element_Base_With_DetId_And_Name* FEB_Temp = NULL;
294  
295        FROG_Element_Base* prim               = new FROG_Element_Base(C_PRIMARY);
296 <      FROG_Element_Base* geom               = new FROG_Element_Base(C_GEOMETRY);                          prim->addDaughter(geom);
297 <      FROG_Element_Base_With_DetId* tracker = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_TRK);   geom->addDaughter(tracker);
298 <      FROG_Element_Base_With_DetId* muon    = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_MUON);  geom->addDaughter(muon);
299 <      FROG_Element_Base_With_DetId* ecal    = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_ECAL);  geom->addDaughter(ecal);
300 <      FROG_Element_Base_With_DetId* hcal    = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_HCAL);  geom->addDaughter(hcal);
296 >      FROG_Element_Base* geom               = new FROG_Element_Base(C_GEOMETRY);                                  prim->addDaughter(geom);
297 >      FROG_Element_Base_With_DetId_And_Name* tracker = new FROG_Element_Base_With_DetId_And_Name( DETID_TRK  , "Tracker"); geom->addDaughter(tracker);
298 >      FROG_Element_Base_With_DetId_And_Name* muon    = new FROG_Element_Base_With_DetId_And_Name( DETID_MUON , "Muon");    geom->addDaughter(muon);
299 >      FROG_Element_Base_With_DetId_And_Name* ecal    = new FROG_Element_Base_With_DetId_And_Name( DETID_ECAL , "ECAL");    geom->addDaughter(ecal);
300 >      FROG_Element_Base_With_DetId_And_Name* hcal    = new FROG_Element_Base_With_DetId_And_Name( DETID_HCAL , "HCAL");    geom->addDaughter(hcal);
301 >      FROG_Element_Base_With_DetId_And_Name* calo    = new FROG_Element_Base_With_DetId_And_Name( DETID_CALO , "Calo");    geom->addDaughter(calo);
302 >
303  
304  
305        // ### TRACKER GEOMETRY ###
# Line 282 | Line 356 | Frog_Analyzer::beginJob(const edm::Event
356           FEB        = tracker;
357  
358           Frog_DetId += SubDet*100000;
359 <         FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
359 >         FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
360           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
361 <         if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
361 > //         if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);}
362  
363           if(SubDet==PixelSubdetector::PixelBarrel){
364 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "PIB"); FEB_Temp->addDaughter(FEB);}
365 +
366              PXBDetId detid = PXBDetId(Detid);
367  
368              Frog_DetId += detid.layer()*10000;
369 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
369 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
370              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
371 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
371 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Layer%i", detid.layer() ); FEB_Temp->addDaughter(FEB);}
372  
373              Frog_DetId += detid.ladder()*100;
374 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
374 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
375              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
376 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
376 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ladder%i", detid.ladder() ); FEB_Temp->addDaughter(FEB);}
377           }else if(SubDet==PixelSubdetector::PixelEndcap){
378 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "PIE"); FEB_Temp->addDaughter(FEB);}
379 +
380              PXFDetId detid = PXFDetId(Detid);
381  
382              Frog_DetId += detid.side()*10000;
383 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
383 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
384              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
385 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
385 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%i",detid.side()); FEB_Temp->addDaughter(FEB);}
386  
387              Frog_DetId += detid.disk()*1000;
388 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
388 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
389              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
390 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
390 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Disk%i", detid.disk()); FEB_Temp->addDaughter(FEB);}
391  
392              Frog_DetId += detid.blade()*10;
393 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
393 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
394              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
395 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
395 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Blade%i", detid.blade()); FEB_Temp->addDaughter(FEB);}
396  
397              Frog_DetId += detid.panel()*1;
398 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
398 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
399              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
400 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
400 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Panel%i", detid.panel()); FEB_Temp->addDaughter(FEB);}
401           }else if(SubDet==StripSubdetector::TIB){
402 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TIB"); FEB_Temp->addDaughter(FEB);}
403 +
404              TIBDetId detid = TIBDetId(Detid);
405  
406              Frog_DetId += detid.layer()*10000;
407 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
407 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
408              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
409 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
409 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Layer%i", detid.layer()); FEB_Temp->addDaughter(FEB);}
410  
411              Frog_DetId += detid.stringNumber()*100;
412 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
412 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
413              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
414 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
414 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "String%i", detid.stringNumber()); FEB_Temp->addDaughter(FEB);}
415           }else if(SubDet==StripSubdetector::TID){
416 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TID"); FEB_Temp->addDaughter(FEB);}
417 +
418              TIDDetId detid = TIDDetId(Detid);
419  
420              Frog_DetId += detid.side()*10000;
421 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
421 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
422              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
423 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
423 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Slide%i", detid.side()); FEB_Temp->addDaughter(FEB);}
424  
425              Frog_DetId += detid.wheel()*1000;
426 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
426 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
427              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
428 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
428 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Wheel%i", detid.wheel()); FEB_Temp->addDaughter(FEB);}
429  
430              Frog_DetId += detid.ring()*10;
431 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
431 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
432              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
433 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
433 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
434           }else if(SubDet==StripSubdetector::TOB){
435 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TOB"); FEB_Temp->addDaughter(FEB);}
436 +
437              TOBDetId detid = TOBDetId(Detid);
438  
439              Frog_DetId += detid.layer()*10000;
440 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
440 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
441              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
442 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
442 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Layer%i",  detid.layer()); FEB_Temp->addDaughter(FEB);}
443  
444              Frog_DetId += detid.rodNumber()*100;
445 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
445 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
446              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
447 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
447 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Rod%i", detid.rodNumber()); FEB_Temp->addDaughter(FEB);}
448           }else if(SubDet==StripSubdetector::TEC){
449 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TEC"); FEB_Temp->addDaughter(FEB);}
450 +
451              TECDetId detid = TECDetId(Detid);
452  
453              Frog_DetId += detid.side()*10000;
454 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
454 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
455              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
456 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
456 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%i",detid.side()); FEB_Temp->addDaughter(FEB);}
457  
458              Frog_DetId += detid.wheel()*1000;
459 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
459 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
460              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
461 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
461 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Wheel%i", detid.wheel() ); FEB_Temp->addDaughter(FEB);}
462  
463              Frog_DetId += detid.ring()*10;
464 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
464 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
465              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
466 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
466 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
467  
468              Frog_DetId += detid.petalNumber();
469 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
469 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
470              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
471 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
471 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Petal%i", detid.petalNumber()); FEB_Temp->addDaughter(FEB);}
472           }else{
473              if(mod)delete mod;
474              continue;
# Line 457 | Line 543 | Frog_Analyzer::beginJob(const edm::Event
543           FEB        = muon;
544  
545           Frog_DetId += SubDet*100000;
546 <         FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
546 >         FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
547           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
548 <         if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
548 > //         if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);}
549  
550           if(SubDet==1){
551 <                DTChamberId detid = DTChamberId(Detid);
551 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "DT"); FEB_Temp->addDaughter(FEB);}
552 >
553 >            DTChamberId detid = DTChamberId(Detid);
554  
555              Frog_DetId += (detid.wheel()+3)*10000;
556 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
556 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
557              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
558 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
558 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Wheel%+i", detid.wheel()); FEB_Temp->addDaughter(FEB);}
559  
560              Frog_DetId += detid.station()*100;
561 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
561 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
562              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
563 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
563 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);}
564  
565              Frog_DetId += detid.sector()*1;
566 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
566 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
567              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
568 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
568 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Sector%i", detid.sector()); FEB_Temp->addDaughter(FEB);}
569           }else if(SubDet==2){
570 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "CSC"); FEB_Temp->addDaughter(FEB);}
571 +
572              CSCDetId detid = CSCDetId(Detid);
573    
574              Frog_DetId += detid.endcap()*10000;
575 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
575 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
576              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
577 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
577 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%i", detid.endcap()); FEB_Temp->addDaughter(FEB);}
578    
579              Frog_DetId += detid.station()*1000;
580 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
580 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
581              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
582 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
582 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);}
583    
584              Frog_DetId += detid.ring()*100;
585 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
585 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
586              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
587 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
587 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
588  
589              Frog_DetId += detid.chamber()*1;
590 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
590 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
591              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
592 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
592 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Chamber%i", detid.chamber()); FEB_Temp->addDaughter(FEB);}
593           }else if(SubDet==3){
594 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "RPC"); FEB_Temp->addDaughter(FEB);}
595 +
596              RPCDetId detid = RPCDetId(Detid);
597  
598              Frog_DetId += (detid.region()+2)*10000;
599 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
599 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
600              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
601 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
601 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Region+%i", detid.region()); FEB_Temp->addDaughter(FEB);}
602  
603              // Barrel
604              if(detid.region()==0){
605                 Frog_DetId += (detid.ring()+3)*1000;
606 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
606 >               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
607                 FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
608 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
608 >               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring+%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
609              // Endcap
610              }else{
611                 Frog_DetId += detid.ring()*1000;
612 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
612 >               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
613                 FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
614 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
614 >               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring+%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
615              }
616  
617              Frog_DetId += detid.station()*100;
618 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
618 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
619              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
620 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
620 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);}
621  
622              Frog_DetId += detid.sector()*1;
623 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
623 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
624              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
625 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
625 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Sector%i", detid.sector()); FEB_Temp->addDaughter(FEB);}
626           }
627  
628           FEB->addDaughter(mod);
# Line 541 | Line 633 | Frog_Analyzer::beginJob(const edm::Event
633        // ### CALO GEOMETRY ###
634  
635        edm::ESHandle<CaloGeometry> CaloGeom;
636 <      iSetup.get<IdealGeometryRecord>().get( CaloGeom );
636 > //      iSetup.get<CaloGeometryRecord>().get( CaloGeom );
637 >      iSetup.get<CaloGeometryRecord>().get( CaloGeom );
638        const vector<DetId> CaloDets = CaloGeom->getValidDetIds();
639  
640        for(unsigned int i=0;i<CaloDets.size();i++)
# Line 549 | Line 642 | Frog_Analyzer::beginJob(const edm::Event
642           Detid  = CaloDets[i];
643           SubDet = Detid.subdetId();
644  
645 <         if(Detid.det()==DetId::Ecal){
646 <             if(SubDet<1 || SubDet>3) continue;
554 <
555 <            Frog_DetId = DETID_ECAL;
556 <            FEB        = ecal;
557 <
558 <            Frog_DetId += SubDet*100000;
559 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
560 <            FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
561 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
562 <
563 <            if(SubDet==1){
564 <               EBDetId detid = EBDetId(Detid);
645 >                 if(Detid.det()==DetId::Ecal){
646 >                        if(SubDet<1 || SubDet>3) continue;
647  
648 <               Frog_DetId += ((detid.zside()==1)+1)*10000;
649 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
568 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
569 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
570 <
571 <               Frog_DetId += (detid.tower_ieta()*detid.zside())*100;
572 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
573 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
574 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
575 <
576 <               Frog_DetId += detid.tower_iphi()*1;
577 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
578 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
579 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
580 <            }else if(SubDet==2){
581 <               EEDetId detid = EEDetId(Detid);
582 <
583 <               Frog_DetId += ((detid.zside()==1)+1)*10000;
584 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
585 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
586 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
648 >                        Frog_DetId = DETID_ECAL;
649 >                        FEB        = ecal;
650  
651 <               Frog_DetId += detid.iquadrant()*1000;
652 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
653 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
654 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
651 >                        Frog_DetId += SubDet*100000;
652 >                        FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
653 >                        FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
654 > //                      if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);}
655 >
656 >                        if(SubDet==1){
657 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "EB"); FEB_Temp->addDaughter(FEB);}
658 >
659 >                           EBDetId detid = EBDetId(Detid);
660 >
661 >                           Frog_DetId += ((detid.zside()==1)+1)*10000;
662 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
663 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
664 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
665 >
666 >                           Frog_DetId += (detid.tower_ieta()*detid.zside())*100;
667 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
668 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
669 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TowerIEta%+i", detid.tower_ieta()); FEB_Temp->addDaughter(FEB);}
670 >
671 >                           Frog_DetId += detid.tower_iphi()*1;
672 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
673 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
674 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TowerIPhi%i", detid.tower_iphi()); FEB_Temp->addDaughter(FEB);}
675 >                        }else if(SubDet==2){
676 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "EE"); FEB_Temp->addDaughter(FEB);}
677 >
678 >                           EEDetId detid = EEDetId(Detid);
679 >
680 >                           Frog_DetId += ((detid.zside()==1)+1)*10000;
681 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
682 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
683 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
684 >
685 >                           Frog_DetId += detid.iquadrant()*1000;
686 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
687 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
688 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Quadran%i", detid.iquadrant()); FEB_Temp->addDaughter(FEB);}
689 >
690 >                           Frog_DetId += detid.isc();
691 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
692 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
693 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "ISC%i", detid.isc()); FEB_Temp->addDaughter(FEB);}
694 >                        }else if(SubDet==3){
695 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "ES"); FEB_Temp->addDaughter(FEB);}
696  
697 <               Frog_DetId += detid.isc();
594 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
595 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
596 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
597 <            }else if(SubDet==3){
598 <               ESDetId detid = ESDetId(Detid);
697 >                           ESDetId detid = ESDetId(Detid);
698  
699 <               Frog_DetId += ((detid.zside()==1)+1)*10000;
700 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
701 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
702 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
703 <
704 <               Frog_DetId += detid.plane()*1000;
705 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
706 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
707 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
708 <
709 <               Frog_DetId += detid.six()*50;
710 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
711 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
712 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
713 <
714 <               Frog_DetId += detid.siy();
715 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
716 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
717 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
718 <             }
719 <         }else if(Detid.det()==DetId::Hcal){
720 <            if(SubDet<1 || SubDet>4) continue;
699 >                           Frog_DetId += ((detid.zside()==1)+1)*10000;
700 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
701 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
702 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
703 >
704 >                           Frog_DetId += detid.plane()*1000;
705 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
706 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
707 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Plane%i", detid.plane()); FEB_Temp->addDaughter(FEB);}
708 >
709 >                           Frog_DetId += detid.six()*50;
710 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
711 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
712 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Six%i", detid.six()); FEB_Temp->addDaughter(FEB);}
713 >
714 >                           Frog_DetId += detid.siy();
715 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
716 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
717 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Siy%i", detid.siy()); FEB_Temp->addDaughter(FEB);}
718 >                         }
719 >                 }else if(Detid.det()==DetId::Hcal){
720 >                        if(SubDet<1 || SubDet>4) continue;
721 >
722 >                        Frog_DetId = DETID_HCAL;
723 >                        FEB        = hcal;
724 >
725 >                        Frog_DetId += SubDet*100000;
726 >                        FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
727 >                        FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
728 >                        if(FEB==NULL){
729 >                                if(SubDet==1){   FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HB"); FEB_Temp->addDaughter(FEB);}
730 >                                if(SubDet==2){   FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HE"); FEB_Temp->addDaughter(FEB);}
731 >                                if(SubDet==3){   FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HO"); FEB_Temp->addDaughter(FEB);}
732 >                                if(SubDet==4){   FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HF"); FEB_Temp->addDaughter(FEB);}
733 >                        }
734 >
735 >                        HcalDetId detid = HcalDetId(Detid);
736 >
737 >                        Frog_DetId += ((detid.zside()==1)+1)*10000;
738 >                        FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
739 >                        FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
740 >                        if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
741 >
742 >                        Frog_DetId += detid.ietaAbs()*100;
743 >                        FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
744 >                        FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
745 >                        if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IEta%+i", detid.ieta()); FEB_Temp->addDaughter(FEB);}
746 >
747 >                        Frog_DetId += detid.iphi()*1;
748 >                        FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
749 >                        FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
750 >                        if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IPhi%i", detid.iphi()); FEB_Temp->addDaughter(FEB);}
751  
752 <            Frog_DetId = DETID_HCAL;
624 <            FEB        = hcal;
625 <
626 <            Frog_DetId += SubDet*100000;
627 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
628 <            FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
629 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
630 <
631 <            if(true){
632 <               HcalDetId detid = HcalDetId(Detid);
633 <
634 <               Frog_DetId += ((detid.zside()==1)+1)*10000;
635 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
636 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
637 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
638 <
639 <               Frog_DetId += detid.ietaAbs()*100;
640 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
641 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
642 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
752 >                 }else if(Detid.det() == DetId::Calo){        
753  
754 <               Frog_DetId += detid.iphi()*1;
755 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
646 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
647 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
648 <            }
754 >                   Frog_DetId = DETID_CALO;
755 >                   FEB        = calo;
756  
757 <         }else if(Detid.det() == DetId::Calo){
651 <         continue;
652 <         /*
653 <            Frog_DetId = DETID_CALO + 1000000;
654 <            FEB        = hcal;
757 >                   if(SubDet!=(unsigned int)CaloTowerDetId::SubdetId)continue;
758  
759 <            Frog_DetId += SubDet*100000;
760 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
761 <            FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
762 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
763 <         */
764 <         }
759 >                   Frog_DetId += SubDet*100000;
760 >                   FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
761 >                   FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
762 >                   if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "CaloTowers"); FEB_Temp->addDaughter(FEB);}
763 >
764 >                   if(SubDet==(unsigned int)CaloTowerDetId::SubdetId){
765 >                      CaloTowerDetId detid = CaloTowerDetId(Detid);
766 >
767 >                      Frog_DetId += ((detid.zside()==1)+1)*10000;
768 >                      FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
769 >                      FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
770 >                      if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
771 >
772 >                      Frog_DetId += (detid.ieta()*detid.zside())*100;
773 >                      FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
774 >                      FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
775 >                      if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IEta%+i", detid.ieta()); FEB_Temp->addDaughter(FEB);}
776 >
777 >                      Frog_DetId += detid.iphi()*1;
778 >                      FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
779 >                      FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
780 >                      if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IPhi%i", detid.iphi()); FEB_Temp->addDaughter(FEB);}
781 >                   }
782 >                }
783  
784 <         const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid);
785 <         GlobalPoint CellPos =  CellGeom->getPosition();
786 <         const CaloCellGeometry::CornersVec CellCorners =  CellGeom->getCorners();
787 <
788 <         float cX = (CellCorners[0].x() + CellCorners[2].x())/2;
789 <         float cY = (CellCorners[0].y() + CellCorners[2].y())/2;
790 <         float cZ = (CellCorners[0].z() + CellCorners[2].z())/2;
791 <
792 <         float wX = (CellCorners[1].x() - CellCorners[0].x())/2;
793 <         float wY = (CellCorners[1].y() - CellCorners[0].y())/2;
794 <         float wZ = (CellCorners[1].z() - CellCorners[0].z())/2;
795 <        
796 <         float hX = (CellCorners[3].x() - CellCorners[0].x())/2;
797 <         float hY = (CellCorners[3].y() - CellCorners[0].y())/2;
798 <         float hZ = (CellCorners[3].z() - CellCorners[0].z())/2;
799 <
800 <         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) );
801 <               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) );
802 <
803 <         FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod(
804 <            Detid.rawId(), F,
805 <            cX  ,   cY  , cZ ,
806 <            wX  ,   wY  , wZ ,
807 <            hX  ,   hY  , hZ );
784 >                 const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid);
785 >                 GlobalPoint CellPos =  CellGeom->getPosition();
786 >                 const CaloCellGeometry::CornersVec CellCorners =  CellGeom->getCorners();
787 >
788 >                 float cX = (CellCorners[0].x() + CellCorners[2].x())/2;
789 >                 float cY = (CellCorners[0].y() + CellCorners[2].y())/2;
790 >                 float cZ = (CellCorners[0].z() + CellCorners[2].z())/2;
791 >
792 >                 float wX = (CellCorners[1].x() - CellCorners[0].x())/2;
793 >                 float wY = (CellCorners[1].y() - CellCorners[0].y())/2;
794 >                 float wZ = (CellCorners[1].z() - CellCorners[0].z())/2;
795 >                
796 >                 float hX = (CellCorners[3].x() - CellCorners[0].x())/2;
797 >                 float hY = (CellCorners[3].y() - CellCorners[0].y())/2;
798 >                 float hZ = (CellCorners[3].z() - CellCorners[0].z())/2;
799 >
800 >                 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) );
801 >                           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) );
802 >
803 >                 FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod(
804 >                        Detid.rawId(), F,
805 >                        cX  ,   cY  , cZ ,
806 >                        wX  ,   wY  , wZ ,
807 >                        hX  ,   hY  , hZ );
808  
809 <         FEB->addDaughter(mod);
809 >                 FEB->addDaughter(mod);  
810        }
811  
812        // ### Save .geom ###
813  
814        FROG_Geometry* CMS_Geom = new FROG_Geometry(prim);
815 <      CMS_Geom->Save("CMS.geom");  
815 >      CMS_Geom->Save("CMS.geom", CompressFiles);  
816 >      delete CMS_Geom;
817     }
818  
819 <   events_prim = new FROG_Element_Base(C_PRIMARY);  
819 >   events_prim  = new FROG_Element_Base(C_PRIMARY);  
820 >   events       = new FROG_Events(events_prim);
821   }
822  
823   // ------------ method called once each job just after ending the event loop  ------------
# Line 704 | Line 827 | Frog_Analyzer::endJob()
827     if(NEvents>0){
828        char OutputFileName[1024];
829        sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str());
830 <      if(NEventsInVisFile>=0)sprintf(OutputFileName,"%s_R%i_E%i.vis",OutputFileName,SRun,SEvent);
830 >      if(NEventsInVisFile>=0)sprintf(OutputFileName,"%s_Run%i_1stEvent%08i",OutputFileName,SRun,SEvent);
831        sprintf(OutputFileName,"%s.vis",OutputFileName);
832  
833 <      FROG_Events* events = new FROG_Events(events_prim);
834 <      events->Save((char*) OutputFileName);
833 > //      FROG_Events* events = new FROG_Events(events_prim);
834 >      events->Save((char*) OutputFileName, CompressFiles);
835        delete events;
836        delete events_prim;
837  
838 <      events_prim = new FROG_Element_Base(C_PRIMARY);
838 > //      events_prim = new FROG_Element_Base(C_PRIMARY);
839        NEvents=0;
840     }
841   }
# Line 733 | Line 856 | Frog_Analyzer::analyze(const edm::Event&
856          }
857  
858  
859 <        FROG_Element_Event* event =  new FROG_Element_Event(iEvent.id().run(), iEvent.id().event() );
859 >        FROG_Element_Event* event =  new FROG_Element_Event(iEvent.id().run(), iEvent.id().event(), iEvent.time().value() );
860          events_prim->addDaughter(event);
861  
862          // access the tracker
# Line 749 | Line 872 | Frog_Analyzer::analyze(const edm::Event&
872          edm::ESHandle<RPCGeometry> RpcGeom;
873          iSetup.get<MuonGeometryRecord>().get( RpcGeom );
874  
875 +        edm::ESHandle<CaloGeometry> CaloGeom;
876 +        iSetup.get<CaloGeometryRecord>().get( CaloGeom );
877 +
878 +
879 +        // ### GEN OBJECTS CONTAINER ###
880 +        FROG_Element_Base_With_DetId_And_Name* frogGen = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN, "GEN");
881 +        event->addDaughter(frogGen);
882 +
883 +        // ### GENPARTICLES ###
884 +        FROG_Element_Base_With_DetId_And_Name* frogGenPartColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN_CAND, "GenParticles");
885 +        frogGen->addDaughter(frogGenPartColl);
886 +
887 +
888 +        for(unsigned int i=0;i<GenParticlesProducers.size();i++){
889 +           edm::Handle<GenParticleCollection> h_gen_Particles;
890 +           iEvent.getByLabel(GenParticlesProducers[i], h_gen_Particles);
891 +           GenParticleCollection gen_Particles = *h_gen_Particles.product();
892 +
893 +           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());
894 +           frogGenPartColl->addDaughter(frogGenPartCollb);
895 +
896 +           for(unsigned int h=0;h<gen_Particles.size();h++){
897 +             if(gen_Particles[h].status()!=1)continue;
898 +             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());
899 +             frogGenPartCollb->addDaughter(frogGenPart);
900 +           }
901 +        }
902 +
903 +
904 +        // ### SIM OBJECTS CONTAINER ###
905 +        FROG_Element_Base_With_DetId_And_Name* frogSim = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIM, "SIM");
906 +        event->addDaughter(frogSim);
907 +
908          // ### SIMTRACK ###
909 +        FROG_Element_Base_With_DetId_And_Name* frogSimTrkColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMTRK, "SimTracks");
910 +        frogSim->addDaughter(frogSimTrkColl);
911 +
912          for(unsigned int i=0;i<SimTrackProducers.size();i++){
913             edm::Handle<std::vector< SimTrack > > h_SimTracks;
914             iEvent.getByLabel(SimTrackProducers[i], h_SimTracks);
915             std::vector< SimTrack > SimTrackColl = *h_SimTracks.product();
916  
758           FROG_Element_Base_With_DetId* frogSimTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMTRK + i);
759           event->addDaughter(frogSimTrkColl);
760
917             for ( unsigned int a = 0; a < SimTrackColl.size(); ++a ) {
918                  SimTrack    simTrack    =SimTrackColl[a];
919  
# Line 770 | Line 926 | Frog_Analyzer::analyze(const edm::Event&
926          }
927  
928          // ### SIMVERTEX ###
929 +        FROG_Element_Base_With_DetId_And_Name* frogSimVtx = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMVTX, "SimVertex");
930 +        frogSim->addDaughter(frogSimVtx);
931 +
932          for(unsigned int i=0;i<SimVertexProducers.size();i++){
933             edm::Handle<std::vector< SimVertex > > h_Vertex;
934             iEvent.getByLabel(SimVertexProducers[i], h_Vertex);
935             std::vector< SimVertex > VertexColl = *h_Vertex.product();
936  
778           FROG_Element_Base_With_DetId* frogSimVtxColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMVTX + i);
779           event->addDaughter(frogSimVtxColl);
780
937             for (unsigned int b = 0; b < VertexColl.size(); ++b ) {
938                  SimVertex       Vertex  =  VertexColl[b];
939  
940 <                FROG_Element_Event_Sim_Vertex* frogSimVtx = new FROG_Element_Event_Sim_Vertex(
940 >                FROG_Element_Event_Sim_Vertex* frogSimVertex = new FROG_Element_Event_Sim_Vertex(
941                          Vertex.position().x(),  Vertex.position().y(),  Vertex.position().z(),
942                          Vertex.parentIndex());
943  
944 <                frogSimVtxColl->addDaughter(frogSimVtx);
944 >                frogSimVtx->addDaughter(frogSimVertex);
945             }
946          }
947  
948  
949          // ### SIMHIT ###
950  
951 +        FROG_Element_Base_With_DetId_And_Name* frogSimHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMHIT, "SimHits");
952 +        frogSim->addDaughter(frogSimHit);
953          for(unsigned int i=0;i<SimHitProducers.size();i++){
954             edm::Handle<std::vector< PSimHit > > h_Hits;
955             iEvent.getByLabel(SimHitProducers[i], h_Hits);
956             std::vector< PSimHit > Hits = *h_Hits.product();
957  
958 <           FROG_Element_Base_With_DetId* frogSimHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMHIT + i);
959 <           event->addDaughter(frogSimHitColl);
958 >           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() );
959 >           frogSimHit->addDaughter(frogSimHitColl);
960  
961             for(unsigned int h=0; h<Hits.size(); h++)
962             {
963                  DetId theDetUnitId(Hits[h].detUnitId());
964 <                const GeomDet* theDet = tkGeom->idToDet(theDetUnitId);
964 >                const GeomDet* theDet = NULL;
965 >                if(theDetUnitId.det() == DetId::Tracker)theDet = tkGeom->idToDet(theDetUnitId);
966 >                if(theDetUnitId.det() == DetId::Muon && theDetUnitId.subdetId() == MuonSubdetId::DT) theDet = DtGeom->idToDet(theDetUnitId);
967 >                if(theDetUnitId.det() == DetId::Muon && theDetUnitId.subdetId() == MuonSubdetId::CSC)theDet = CscGeom->idToDet(theDetUnitId);
968 >                if(theDetUnitId.det() == DetId::Muon && theDetUnitId.subdetId() == MuonSubdetId::RPC)theDet = RpcGeom->idToDet(theDetUnitId);
969  
970                  
971                  FROG_Element_Event_Sim_Hit* frogSimHit = new FROG_Element_Event_Sim_Hit(
# Line 813 | Line 975 | Frog_Analyzer::analyze(const edm::Event&
975             }
976          }
977  
978 +        // ### SIMCALOHIT ###
979  
980 +        for(unsigned int i=0;i<SimCaloHitProducers.size();i++){
981 +           edm::Handle<std::vector< PCaloHit > > h_CaloHits;
982 +           iEvent.getByLabel(SimCaloHitProducers[i], h_CaloHits);
983 +           std::vector< PCaloHit > CaloHits = *h_CaloHits.product();
984 +
985 +           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());
986 +           frogSimHit->addDaughter(frogSimHitColl);
987 +
988 +           for(unsigned int h=0; h<CaloHits.size(); h++)
989 +           {
990 +                DetId theDetUnitId(CaloHits[h].id());
991 +                const CaloCellGeometry* CellGeom = NULL;
992 +                if(theDetUnitId.det() == DetId::Ecal || theDetUnitId.det() == DetId::Hcal)CellGeom = CaloGeom->getGeometry(theDetUnitId);
993 +                if(CellGeom==NULL)continue;
994 +
995 +
996 +                FROG_Element_Event_Sim_Hit* frogSimCaloHit = new FROG_Element_Event_Sim_Hit(
997 +                        CellGeom->getPosition().x(),CellGeom->getPosition().y(),CellGeom->getPosition().z(),
998 +                        CaloHits[h].energy(), CaloHits[h].depth() );
999 +                frogSimHitColl->addDaughter(frogSimCaloHit);
1000 +           }
1001 +        }
1002  
818        // ### TRAJECTORY ###
819        for(unsigned int i=0;i<TrajectoryProducers.size();i++){
820             Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle;
821             iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle);
822             const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product();
1003  
824             FROG_Element_Base_With_DetId* frogTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK + i);
825             event->addDaughter(frogTrkColl);
1004  
827             for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) {
828                Trajectory  recoTraj     = *it->key;
829                FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(i,it->val->p(),it->val->pt(),it->key->chiSquared());
830                frogTrkColl->addDaughter(frogTrk);
1005  
1006 <                std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements();
1007 <                for(unsigned int h=0;h<measurements.size();h++){
1006 >        // ### LOW RECO OBJECTS CONTAINER ###
1007 >        FROG_Element_Base_With_DetId_And_Name* frogLowReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_LOWRECO, "RECO LOW");
1008 >        event->addDaughter(frogLowReco);
1009  
835                      TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit();
836                      if(!h_it->isValid() )continue;
837                      DetId detId                = h_it->geographicalId();
838                      GlobalPoint globalPos      = measurements[h].updatedState().globalPosition();
1010  
840                      FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(detId.rawId(), globalPos.x(),globalPos.y(),  globalPos.z(), -1);
841                      frogTrk->addDaughter(frogHit);
842                }
843           }
844        }
1011  
1012 <        // ### TRACK ###
1012 >        // ### SiStrip Clusters ###
1013 >        FROG_Element_Base_With_DetId_And_Name* frogSSTHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_SISTRIPHIT, "SiStrip Clusters");
1014 >        frogLowReco->addDaughter(frogSSTHit);
1015 >        for(unsigned int i=0;i<SiStripClusterProducers.size();i++){
1016 >           edm::Handle<edmNew::DetSetVector<SiStripCluster> > h_Sst_Hits;
1017 >           iEvent.getByLabel(SiStripClusterProducers[i], h_Sst_Hits);
1018 >           const edmNew::DetSetVector<SiStripCluster>&  Sst_Hits = *h_Sst_Hits.product();
1019  
848        for(unsigned int i=0;i<TrackProducers.size();i++){
849           edm::Handle<std::vector< reco::Track > > h_Tracks;
850           iEvent.getByLabel(TrackProducers[i], h_Tracks);
851           std::vector< reco::Track > TrackColl = *h_Tracks.product();
1020  
1021 <           FROG_Element_Base_With_DetId* frogTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK + TrajectoryProducers.size()+i);
1022 <           event->addDaughter(frogTrkColl);
1021 >           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());
1022 >           frogSSTHit->addDaughter(frogSstHitColl);
1023  
856           //printf("Size of the TrackCOllection : %i = %i\n",i,TrackColl.size());
857           for ( unsigned int t = 0; t < TrackColl.size(); ++t ) {
858              reco::Track  recoTrack  =TrackColl[t];
1024  
1025 <              FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(TrajectoryProducers.size()+i,recoTrack.p(),recoTrack.pt(), recoTrack.chi2());
1026 <              frogTrkColl->addDaughter(frogTrk);
1025 >           for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter = Sst_Hits.begin(); DSViter != Sst_Hits.end(); ++DSViter) {
1026 >           edmNew::DetSet<SiStripCluster>::const_iterator begin=DSViter->begin();
1027 >           edmNew::DetSet<SiStripCluster>::const_iterator end  =DSViter->end();
1028 >           for(edmNew::DetSet<SiStripCluster>::const_iterator iCluster=begin;iCluster!=end;++iCluster){
1029  
1030 <              for(unsigned int h=0;h<recoTrack.recHitsSize();h++){
1031 <                 TrackingRecHitRef h_it     = recoTrack.recHit(h);
865 <                 if(!h_it->isValid() )continue;
866 <                 DetId detId                = h_it->geographicalId();
867 <                 const GeomDet * theDet = NULL;
1030 >                const GeomDetUnit* detUnit = tkGeom->idToDetUnit (DetId( iCluster->geographicalId() ) );
1031 >                if(!detUnit)continue;
1032  
1033 <                 if(detId.det()==DetId::Tracker)                        theDet = tkGeom->idToDet(detId);
1034 <                 if(detId.det()==DetId::Muon && detId.subdetId() == 1)  theDet = DtGeom->idToDet(detId);
871 <                 if(detId.det()==DetId::Muon && detId.subdetId() == 2)  theDet = CscGeom->idToDet(detId);
872 <                 if(detId.det()==DetId::Muon && detId.subdetId() == 3)  theDet = RpcGeom->idToDet(detId);
1033 >                const StripGeomDetUnit* DetUnit = dynamic_cast<const StripGeomDetUnit*> ( detUnit  );
1034 >                if(!DetUnit)continue;
1035  
1036 <                 LocalPoint localPos        = h_it->localPosition();
1036 >                const StripTopology& Topo  = DetUnit->specificTopology();
1037 >
1038 >                unsigned int Charge = 0;
1039 >                for(unsigned int i=0;i<iCluster->amplitudes().size();i++){Charge+=iCluster->amplitudes()[i];}
1040 >
1041 >                unsigned int MiddleStrip = iCluster->firstStrip() + iCluster->amplitudes().size()/2;
1042 >
1043 >                float Pitch = DetUnit->surface().bounds().width() / Topo.nstrips();
1044 >                float XPos = (MiddleStrip * Pitch) - DetUnit->surface().bounds().width()/2;
1045 >                //float YPos = DetUnit->surface().bounds().thickness()/2;
1046 >                //float ZPos = DetUnit->surface().bounds().length()/2;
1047 >
1048 >                Surface::GlobalPoint Pos  = DetUnit->surface().toGlobal( LocalPoint(XPos, 0, 0) );
1049 >
1050 >
1051 >                FROG_Element_Event_Hit_SiStrip* frogStripHit = new FROG_Element_Event_Hit_SiStrip(iCluster->geographicalId(), iCluster->firstStrip(), Pitch);
1052 >                for(unsigned int i=0;i<iCluster->amplitudes().size();i++){frogStripHit->Ampl_.push_back(iCluster->amplitudes()[i]);}
1053 >                frogSstHitColl->addDaughter(frogStripHit);
1054 >           }}
1055  
876                 FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(
877                        detId.rawId(),
878                        theDet->surface().toGlobal(localPos).x(),
879                        theDet->surface().toGlobal(localPos).y(),
880                        theDet->surface().toGlobal(localPos).z(),
881                        -1);
882                 frogTrk->addDaughter(frogHit);
883              }
884           }
1056          }
1057  
1058  
1059  
1060 +        // ### CALORecHits ###
1061 +        FROG_Element_Base_With_DetId_And_Name* frogCaloHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_CALOHIT, "CALO Hits");
1062 +        frogLowReco->addDaughter(frogCaloHit);
1063 +
1064 +
1065          // ### ECALRecHits ###
1066 +        FROG_Element_Base_With_DetId_And_Name* frogEcalHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_ECALHIT, "ECAL RecHits");
1067 +        frogCaloHit->addDaughter(frogEcalHit);
1068          for(unsigned int i=0;i<EcalRecHitProducers.size();i++){
1069             edm::Handle<EcalRecHitCollection > h_Ecal_RecHits;
1070             iEvent.getByLabel(EcalRecHitProducers[i], h_Ecal_RecHits);
1071             EcalRecHitCollection Ecal_RecHits = *h_Ecal_RecHits.product();
1072  
1073 <           FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_ECALHIT + i);
1074 <           event->addDaughter(frogHitColl);
1073 >           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());
1074 >           frogEcalHit->addDaughter(frogHitColl);
1075  
1076             for(unsigned int eh=0;eh<Ecal_RecHits.size();eh++){
1077                  FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((Ecal_RecHits[eh].detid()).rawId(),
# Line 904 | Line 1082 | Frog_Analyzer::analyze(const edm::Event&
1082  
1083  
1084          // ### HCALRecHits ###
1085 +        FROG_Element_Base_With_DetId_And_Name* frogHcalHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_HCALHIT, "HCAL RecHits");
1086 +        frogCaloHit->addDaughter(frogHcalHit);
1087          for(unsigned int i=0;i<HcalHBHERecHitProducers.size();i++){
1088             edm::Handle<HBHERecHitCollection > h_HcalHBHE_RecHits;
1089             iEvent.getByLabel(HcalHBHERecHitProducers[i], h_HcalHBHE_RecHits);
1090             HBHERecHitCollection HcalHBHE_RecHits = *h_HcalHBHE_RecHits.product();
1091  
1092 <           FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + i);
1093 <           event->addDaughter(frogHitColl);
1092 >           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());
1093 >           frogHcalHit->addDaughter(frogHitColl);
1094  
1095             for(unsigned int hh=0;hh<HcalHBHE_RecHits.size();hh++){
1096                  FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHBHE_RecHits[hh].detid()).rawId(),
# Line 924 | Line 1104 | Frog_Analyzer::analyze(const edm::Event&
1104             iEvent.getByLabel(HcalHORecHitProducers[i], h_HcalHO_RecHits);
1105             HORecHitCollection HcalHO_RecHits = *h_HcalHO_RecHits.product();
1106  
1107 <           FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + HcalHBHERecHitProducers.size() + i);
1108 <           event->addDaughter(frogHitColl);
1107 >           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());
1108 >           frogHcalHit->addDaughter(frogHitColl);
1109  
1110             for(unsigned int hh=0;hh<HcalHO_RecHits.size();hh++){
1111                  FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHO_RecHits[hh].detid()).rawId(),
# Line 939 | Line 1119 | Frog_Analyzer::analyze(const edm::Event&
1119             iEvent.getByLabel(HcalHFRecHitProducers[i], h_HcalHF_RecHits);
1120             HFRecHitCollection HcalHF_RecHits = *h_HcalHF_RecHits.product();
1121  
1122 <           FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + HcalHBHERecHitProducers.size() + HcalHORecHitProducers.size() + i);
1123 <           event->addDaughter(frogHitColl);
1122 >           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());
1123 >           frogHcalHit->addDaughter(frogHitColl);
1124  
1125             for(unsigned int hh=0;hh<HcalHF_RecHits.size();hh++){
1126                  FROG_Element_Event_CaloHit* frogCaloHit = new FROG_Element_Event_CaloHit((HcalHF_RecHits[hh].detid()).rawId(),
# Line 949 | Line 1129 | Frog_Analyzer::analyze(const edm::Event&
1129             }
1130          }
1131  
1132 +
1133          // ### Muon Segments ###
1134 +        FROG_Element_Base_With_DetId_And_Name* frogMuonSeg = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONSEG, "MuonSegments");
1135 +        frogLowReco->addDaughter(frogMuonSeg);
1136 +
1137          for(unsigned int i=0;i<CSCSegmentProducers.size();i++){
1138             edm::Handle<CSCSegmentCollection > h_CSC_Segments;
1139             iEvent.getByLabel(CSCSegmentProducers[i], h_CSC_Segments);
1140             CSCSegmentCollection CSC_Segments = *h_CSC_Segments.product();
1141  
1142 <           FROG_Element_Base_With_DetId* frogSegColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG + i);
1143 <           event->addDaughter(frogSegColl);
1142 >           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());
1143 >           frogMuonSeg->addDaughter(frogSegColl);
1144  
1145             for(unsigned int s=0;s<CSC_Segments.size();s++){
1146                  DetId theDetUnitId = CSC_Segments[s].geographicalId();
# Line 974 | Line 1158 | Frog_Analyzer::analyze(const edm::Event&
1158             iEvent.getByLabel(DTSegmentProducers[i], h_DT_Segments);
1159             DTRecSegment4DCollection DT_Segments = *h_DT_Segments.product();
1160  
1161 <           FROG_Element_Base_With_DetId* frogSegColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG + CSCSegmentProducers.size() + i);
1162 <           event->addDaughter(frogSegColl);
1161 >           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());
1162 >           frogMuonSeg->addDaughter(frogSegColl);
1163  
1164             for(unsigned int s=0;s<DT_Segments.size();s++){
1165                  DetId theDetUnitId = DT_Segments[s].geographicalId();
# Line 989 | Line 1173 | Frog_Analyzer::analyze(const edm::Event&
1173          }
1174  
1175          // ### Muon Hits ###
1176 +        FROG_Element_Base_With_DetId_And_Name* frogMuonHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONHIT, "MuonHits");
1177 +        frogLowReco->addDaughter(frogMuonHit);
1178          for(unsigned int i=0;i<RPCHitsProducers.size();i++){
1179             edm::Handle<RPCRecHitCollection > h_RPC_Hits;
1180             iEvent.getByLabel(RPCHitsProducers[i], h_RPC_Hits);
1181             RPCRecHitCollection RPC_Hits = *h_RPC_Hits.product();
1182  
1183 <           FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONHIT + i);
1184 <           event->addDaughter(frogHitColl);
1183 >           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());
1184 >           frogMuonHit->addDaughter(frogHitColl);
1185  
1186             for(unsigned int h=0;h<RPC_Hits.size();h++){
1187                  DetId theDetUnitId = RPC_Hits[h].geographicalId();
# Line 1007 | Line 1193 | Frog_Analyzer::analyze(const edm::Event&
1193             }
1194          }
1195  
1196 +
1197 +        // ### Calo Towers ###
1198 +        FROG_Element_Base_With_DetId_And_Name* frogCaloTower = new FROG_Element_Base_With_DetId_And_Name( EVTID_CALOTOWER, "CaloTowers");
1199 +        frogLowReco->addDaughter(frogCaloTower);
1200 +        for(unsigned int i=0;i<CaloTowersProducers.size();i++){
1201 +           edm::Handle<CaloTowerCollection> h_Calo_Towers;
1202 +           iEvent.getByLabel(CaloTowersProducers[i], h_Calo_Towers);
1203 +           CaloTowerCollection Calo_Towers = *h_Calo_Towers.product();
1204 +
1205 +           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());
1206 +           frogCaloTower->addDaughter(frogCaloTowerColl);
1207 +
1208 +           for(unsigned int h=0;h<Calo_Towers.size();h++){
1209 +                FROG_Element_Event_CaloTower* frogTower = new FROG_Element_Event_CaloTower(Calo_Towers[h].id().rawId(), Calo_Towers[h].emEnergy(),Calo_Towers[h].hadEnergy());
1210 +                frogCaloTowerColl->addDaughter(frogTower);
1211 +
1212 +                if(i==0 && CaloTowersProducersBasedOnCaloHits){
1213 +                   frogTower->Components_CollEvtId_ = EVTID_CALOHIT;
1214 +
1215 +
1216 +                     for(unsigned int D=0;D<Calo_Towers[h].constituentsSize();D++){frogTower->Components_Vector_.push_back(Calo_Towers[h].constituent(D));}                  
1217 +
1218 + //                   std::vector<DetId> TowersDetIds = Calo_Towers[h].constituents();
1219 + //                   for(unsigned int D=0;D<TowersDetIds.size();D++){frogTower->Components_Vector_.push_back(TowersDetIds[D]);}
1220 +                }
1221 +
1222 +           }
1223 +        }
1224 +
1225 +
1226 +
1227 +        // ### MED RECO OBJECTS CONTAINER ###
1228 +        FROG_Element_Base_With_DetId_And_Name* frogMedReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_MEDRECO, "RECO MED");
1229 +        event->addDaughter(frogMedReco);
1230 +
1231 +
1232 +
1233 +
1234 +
1235 +        FROG_Element_Base_With_DetId_And_Name* frogNIVertex = new FROG_Element_Base_With_DetId_And_Name( EVTID_NUCLINT, "Vertex from NI");
1236 +        frogMedReco->addDaughter(frogNIVertex);
1237 +
1238 +        // NUCLEAR INTERACTIONS
1239 +        for(unsigned int i=0;i<NIProducers.size();i++) {
1240 +          edm::Handle<std::vector<reco::NuclearInteraction> > h_NIs;
1241 +          iEvent.getByLabel(NIProducers[i], h_NIs);
1242 +          std::vector<reco::NuclearInteraction> NIs = *h_NIs.product();
1243 +          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());
1244 +          frogNIVertex->addDaughter(frogNIColl);
1245 +
1246 +          for(unsigned int h=0; h<NIs.size();h++){
1247 +             reco::NuclearInteraction ni = NIs[i];
1248 +             float vtx_x = ni.vertex().x();
1249 +             float vtx_y = ni.vertex().y();
1250 +             float vtx_z = ni.vertex().z();
1251 +             float like  = ni.likelihood();
1252 +             FROG_Element_Event_NuclInt*  frogNI = new FROG_Element_Event_NuclInt(vtx_x, vtx_y, vtx_z, like );
1253 +             frogNIColl->addDaughter(frogNI);
1254 +          }
1255 +        }
1256 +
1257 +
1258 +
1259 +        // ### TRAJECTORY ###
1260 +        FROG_Element_Base_With_DetId_And_Name* frogTrk = new FROG_Element_Base_With_DetId_And_Name( EVTID_TRK, "Tracks & Trajectories");
1261 +        frogMedReco->addDaughter(frogTrk);
1262 +
1263 +        for(unsigned int i=0;i<TrajectoryProducers.size();i++){
1264 +             Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle;
1265 +             iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle);
1266 +             const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product();
1267 +
1268 +             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());
1269 +             frogTrk->addDaughter(frogTrkColl);
1270 +
1271 +             for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) {
1272 +                Trajectory  recoTraj     = *it->key;
1273 +                FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(i,it->val->p(),it->val->pt(),it->key->chiSquared());
1274 +                frogTrkColl->addDaughter(frogTrk);
1275 +
1276 +                std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements();
1277 +                for(unsigned int h=0;h<measurements.size();h++){
1278 +
1279 +                      TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit();
1280 +                      if(!h_it->isValid() )continue;
1281 +                      DetId detId                = h_it->geographicalId();
1282 +                      GlobalPoint globalPos      = measurements[h].updatedState().globalPosition();
1283 +
1284 +                      FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(detId.rawId(), globalPos.x(),globalPos.y(),  globalPos.z(), -1);
1285 +                      frogTrk->addDaughter(frogHit);
1286 +                }
1287 +              //  printf("Add a Trajectory\n");
1288 +           }
1289 +        }
1290 +
1291 +
1292 +
1293 +
1294 +        // ### TRACK ###
1295 +
1296 +        for(unsigned int i=0;i<TrackProducers.size();i++){
1297 +           edm::Handle<std::vector< reco::Track > > h_Tracks;
1298 +           iEvent.getByLabel(TrackProducers[i], h_Tracks);
1299 +           std::vector< reco::Track > TrackColl = *h_Tracks.product();
1300 +
1301 +           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());
1302 +           frogTrk->addDaughter(frogTrkColl);
1303 +
1304 +           //printf("Size of the TrackCOllection : %i = %i\n",i,TrackColl.size());
1305 +           for ( unsigned int t = 0; t < TrackColl.size(); ++t ) {
1306 +              reco::Track  recoTrack  =TrackColl[t];
1307 +
1308 +              FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(TrajectoryProducers.size()+i,recoTrack.p(),recoTrack.pt(), recoTrack.chi2());
1309 +              frogTrkColl->addDaughter(frogTrk);
1310 +
1311 +              for(unsigned int h=0;h<recoTrack.recHitsSize();h++){
1312 +                 TrackingRecHitRef h_it     = recoTrack.recHit(h);
1313 +                 if(!h_it->isValid() )continue;
1314 +                 DetId detId                = h_it->geographicalId();
1315 +                 const GeomDet * theDet = NULL;
1316 +
1317 +                 if(detId.det()==DetId::Tracker)                        theDet = tkGeom->idToDet(detId);
1318 +                 if(detId.det()==DetId::Muon && detId.subdetId() == 1)  theDet = DtGeom->idToDet(detId);
1319 +                 if(detId.det()==DetId::Muon && detId.subdetId() == 2)  theDet = CscGeom->idToDet(detId);
1320 +                 if(detId.det()==DetId::Muon && detId.subdetId() == 3)  theDet = RpcGeom->idToDet(detId);
1321 +
1322 +                 LocalPoint localPos        = h_it->localPosition();
1323 +
1324 +                 FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(
1325 +                        detId.rawId(),
1326 +                        theDet->surface().toGlobal(localPos).x(),
1327 +                        theDet->surface().toGlobal(localPos).y(),
1328 +                        theDet->surface().toGlobal(localPos).z(),
1329 +                        -1);
1330 +                 frogTrk->addDaughter(frogHit);
1331 +              }
1332 +              //printf("Add a Track\n");
1333 +
1334 +           }
1335 +        }
1336 +
1337 +
1338 +
1339 +
1340 +
1341 +
1342 +        // ### HIGH RECO OBJECTS CONTAINER ###
1343 +        FROG_Element_Base_With_DetId_And_Name* frogHighReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_HIGHRECO, "RECO HIGH");
1344 +        event->addDaughter(frogHighReco);
1345 +
1346 +
1347 +
1348 +        FROG_Element_Base_With_DetId_And_Name* frogJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET, "Jets");
1349 +        frogHighReco->addDaughter(frogJet);
1350 +
1351 +
1352 +        // ### Basic Jets ###
1353 +        FROG_Element_Base_With_DetId_And_Name* frogBasicJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_BASIC, "BasicJets");
1354 +        frogJet->addDaughter(frogBasicJet);
1355 +        for(unsigned int i=0;i<BasicJetsProducers.size();i++){
1356 +           edm::Handle<BasicJetCollection> h_Basic_Jets;
1357 +           iEvent.getByLabel(BasicJetsProducers[i], h_Basic_Jets);
1358 +           BasicJetCollection Basic_Jets = *h_Basic_Jets.product();
1359 +
1360 +           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());
1361 +           frogBasicJet->addDaughter(frogBasicJetColl);
1362 +
1363 +           for(unsigned int h=0;h<Basic_Jets.size();h++){
1364 +                FROG_Element_Event_Jet* frogJet = new FROG_Element_Event_Jet(Basic_Jets[h].p(), Basic_Jets[h].eta(),Basic_Jets[h].phi());
1365 +                frogBasicJet->addDaughter(frogJet);
1366 +           }
1367 +        }
1368 +
1369 +
1370 +        // ### Calo Jets ###
1371 +        FROG_Element_Base_With_DetId_And_Name* frogCaloJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_CALO, "CaloJets");
1372 +        frogJet->addDaughter(frogCaloJet);
1373 +        for(unsigned int i=0;i<CaloJetsProducers.size();i++){
1374 +           edm::Handle<CaloJetCollection> h_Calo_Jets;
1375 +           iEvent.getByLabel(CaloJetsProducers[i], h_Calo_Jets);
1376 +           CaloJetCollection Calo_Jets = *h_Calo_Jets.product();
1377 +
1378 +           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());
1379 +           frogCaloJet->addDaughter(frogCaloJetColl);
1380 +
1381 +           for(unsigned int h=0;h<Calo_Jets.size();h++){
1382 +                FROG_Element_Event_Jet* frogJet = new FROG_Element_Event_Jet(Calo_Jets[h].p(), Calo_Jets[h].eta(),Calo_Jets[h].phi());
1383 +                frogCaloJetColl->addDaughter(frogJet);
1384 +
1385 +                if(CaloJetsProducersBasedOnCaloTowers){
1386 +
1387 +                   std::vector<CaloTowerPtr> CaloTowers = Calo_Jets[h].getCaloConstituents();
1388 +                   frogJet->Components_CollEvtId_ = EVTID_CALOTOWER + 1;
1389 +                   for(unsigned int t=0;t<CaloTowers.size();t++){  frogJet->Components_Vector_.push_back(CaloTowers[t]->id().rawId());}
1390 +                }
1391 +           }
1392 +        }
1393 +
1394 +        // ### MET ###
1395 +        FROG_Element_Base_With_DetId_And_Name* frogMET = new FROG_Element_Base_With_DetId_And_Name( EVTID_MET_CALO, "MET");
1396 +        frogHighReco->addDaughter(frogMET);
1397 +        for(unsigned int i=0;i<CaloMETProducers.size();i++){
1398 +           edm::Handle<CaloMETCollection> h_met;
1399 +           iEvent.getByLabel(CaloMETProducers[i], h_met);
1400 +           CaloMETCollection reco_met = *h_met.product();
1401 +
1402 +           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());
1403 +           frogMET->addDaughter(frogMETColl);
1404 +
1405 +           for(unsigned int h=0;h<reco_met.size();h++){
1406 +                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());
1407 +                frogMETColl->addDaughter(frogMETevt);
1408 +           }
1409 +        }
1410 +
1411 +
1412 +        // ### RecoCandidates ###
1413 +        FROG_Element_Base_With_DetId_And_Name* frogRecoCand = new FROG_Element_Base_With_DetId_And_Name( EVTID_RECOCAND, "RecoCandidates");
1414 +        frogHighReco->addDaughter(frogRecoCand);
1415 +        for(unsigned int i=0;i<RecoCandidateProducers.size();i++){
1416 +           edm::Handle<CandidateCollection> h_reco_Candidates;
1417 +           iEvent.getByLabel(RecoCandidateProducers[i], h_reco_Candidates);
1418 +           CandidateCollection reco_Candidates = *h_reco_Candidates.product();
1419 +
1420 +           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());
1421 +           frogRecoCand->addDaughter(frogRecoCandColl);
1422 +
1423 +           for(unsigned int h=0;h<reco_Candidates.size();h++){
1424 +                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());
1425 +                frogRecoCandColl->addDaughter(frogCandidate);
1426 +           }
1427 +        }
1428 +
1429 +
1430 +
1431     NEvents++;
1011   if(NEvents == NEventsInVisFile){
1012      char OutputFileName[1024];
1013      sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str());
1014      if(NEventsInVisFile>=0)sprintf(OutputFileName,"%s_R%i_E%i.vis",OutputFileName,SRun,SEvent);
1015      sprintf(OutputFileName,"%s.vis",OutputFileName);
1432  
1433 <      FROG_Events* events = new FROG_Events(events_prim);
1434 <      events->Save((char*) OutputFileName);
1433 >   char OutputFileName[1024];
1434 >   sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str());
1435 >   if(NEventsInVisFile>0)sprintf(OutputFileName,"%s_Run%i_1stEvent%08i",OutputFileName,SRun,SEvent);
1436 >   sprintf(OutputFileName,"%s.vis",OutputFileName);
1437 >   events->SaveInLive((char*) OutputFileName, (unsigned int)-1);
1438 >
1439 >   if(NEvents == NEventsInVisFile){
1440        delete events;
1441        delete events_prim;
1442  
1443        events_prim = new FROG_Element_Base(C_PRIMARY);
1444 +      events      = new FROG_Events(events_prim);
1445        NEvents=0;
1024   }
1446  
1447 +      #ifdef FROG_ZLIB
1448 +      if(CompressFiles){
1449 +         FROG_ZLIB_Deflate(OutputFileName);
1450 +      }
1451 +      #endif
1452 +   }
1453   }
1454  
1455  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines