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.27 by querten, Tue Aug 19 14:38:38 2008 UTC vs.
Revision 1.51 by querten, Thu Nov 20 12:07:18 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 "DataFormats/VertexReco/interface/NuclearInteraction.h"
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_Element_Event_NuclInt.h"
155 > #include "Visualisation/Frog/soft/Includes/FROG/FROG_ZLib.h"
156 > #include "Visualisation/Frog/soft/Includes/FROG/FROG_ZLib.cpp"
157 >
158 > #include "Visualisation/Frog/soft/Includes/FROG/FROG_Path.h"
159 > #include "Visualisation/Frog/soft/Includes/FROG/FROG_Path.cpp"
160  
161  
162   using namespace edm;
163   using namespace std;
164 + using namespace reco;
165  
166   //
167   // class decleration
# Line 149 | Line 178 | class Frog_Analyzer : public edm::EDAnal
178        virtual void analyze (const edm::Event&, const edm::EventSetup&);
179        virtual void endJob  ();
180  
181 <      FROG_Element_Base*    events_prim;
181 >      FROG_Events*          events;
182  
183        std::string           OutputFile;
184 +      std::vector<InputTag> GenParticlesProducers;
185  
186        std::vector<InputTag> SimTrackProducers;
187        std::vector<InputTag> SimVertexProducers;
# Line 162 | Line 192 | class Frog_Analyzer : public edm::EDAnal
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 171 | 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 +      bool                  AddRunInfoInName;
220 +
221        bool                  ProduceGeom;
222        int                   NEventsInVisFile;
223        int                   NEvents;
224 +      
225  
226 +
227 +      unsigned int          FileIndex;
228        unsigned int          SRun;
229        unsigned int          SEvent;
230 +
231   };
232  
233   //
# Line 188 | Line 237 | Frog_Analyzer::Frog_Analyzer(const edm::
237   {
238      OutputFile              = iConfig.getParameter<std::string >("OutputFile");
239  
240 +    GenParticlesProducers   = iConfig.getParameter<std::vector<InputTag> >("GenParticlesProducers");
241 +
242      SimTrackProducers       = iConfig.getParameter<std::vector<InputTag> >("SimTrackProducers");
243      SimVertexProducers      = iConfig.getParameter<std::vector<InputTag> >("SimVertexProducers");
244      SimHitProducers         = iConfig.getParameter<std::vector<InputTag> >("SimHitProducers");
# Line 196 | Line 247 | Frog_Analyzer::Frog_Analyzer(const edm::
247  
248      TrackProducers          = iConfig.getParameter<std::vector<InputTag> >("TrackProducers");
249      TrajectoryProducers     = iConfig.getParameter<std::vector<InputTag> >("TrajectoryProducers");
250 +    SiStripClusterProducers = iConfig.getParameter<std::vector<InputTag> >("SiStripClusterProducers");
251      EcalRecHitProducers     = iConfig.getParameter<std::vector<InputTag> >("EcalRecHitProducers");
252      HcalHBHERecHitProducers = iConfig.getParameter<std::vector<InputTag> >("HcalHBHERecHitProducers");
253      HcalHORecHitProducers   = iConfig.getParameter<std::vector<InputTag> >("HcalHORecHitProducers");
# Line 208 | Line 260 | Frog_Analyzer::Frog_Analyzer(const edm::
260  
261      RPCHitsProducers        = iConfig.getParameter<std::vector<InputTag> >("RPCHitsProducers");
262  
263 +    CaloTowersProducers     = iConfig.getParameter<std::vector<InputTag> >("CaloTowersProducers");
264 +    CaloTowersProducersBasedOnCaloHits = iConfig.getParameter<bool>("CaloTowersProducersBasedOnCaloHits");
265 +
266 +
267 +    BasicJetsProducers      = iConfig.getParameter<std::vector<InputTag> >("BasicJetsProducers");
268 +    CaloJetsProducers       = iConfig.getParameter<std::vector<InputTag> >("CaloJetsProducers");
269 +    CaloJetsProducersBasedOnCaloTowers = iConfig.getParameter<bool>("CaloJetsProducersBasedOnCaloTowers");
270 +
271 +    RecoCandidateProducers  = iConfig.getParameter<std::vector<InputTag> >("RecoCandidateProducers");
272 +    CaloMETProducers        = iConfig.getParameter<std::vector<InputTag> >("CaloMETProducers");
273 +
274      ProduceGeom             = iConfig.getParameter<bool  >("ProduceGeom"       );
275      NEventsInVisFile        = iConfig.getParameter<int   >("NEventsInVisFile"  );
276 +    CompressFiles           = iConfig.getParameter<bool  >("CompressFiles"     );
277 +    AddRunInfoInName        = iConfig.getParameter<bool  >("AddRunInfoInName"  );
278  
279 <    NEvents = 0;
279 >    NEvents   = 0;
280 >    FileIndex = 0;
281   }
282  
283  
# Line 229 | Line 295 | Frog_Analyzer::beginJob(const edm::Event
295  
296        unsigned int Frog_DetId;
297        FROG_Element_Base*            FEB      = NULL;
298 <      FROG_Element_Base_With_DetId* FEB_Temp = NULL;
298 >      FROG_Element_Base_With_DetId_And_Name* FEB_Temp = NULL;
299  
300        FROG_Element_Base* prim               = new FROG_Element_Base(C_PRIMARY);
301 <      FROG_Element_Base* geom               = new FROG_Element_Base(C_GEOMETRY);                          prim->addDaughter(geom);
302 <      FROG_Element_Base_With_DetId* tracker = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_TRK);   geom->addDaughter(tracker);
303 <      FROG_Element_Base_With_DetId* muon    = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_MUON);  geom->addDaughter(muon);
304 <      FROG_Element_Base_With_DetId* ecal    = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_ECAL);  geom->addDaughter(ecal);
305 <      FROG_Element_Base_With_DetId* hcal    = new FROG_Element_Base_With_DetId(C_FEB_DETID, DETID_HCAL);  geom->addDaughter(hcal);
301 >      FROG_Element_Base* geom               = new FROG_Element_Base(C_GEOMETRY);                                  prim->addDaughter(geom);
302 >      FROG_Element_Base_With_DetId_And_Name* tracker = new FROG_Element_Base_With_DetId_And_Name( DETID_TRK  , "Tracker"); geom->addDaughter(tracker);
303 >      FROG_Element_Base_With_DetId_And_Name* muon    = new FROG_Element_Base_With_DetId_And_Name( DETID_MUON , "Muon");    geom->addDaughter(muon);
304 >      FROG_Element_Base_With_DetId_And_Name* ecal    = new FROG_Element_Base_With_DetId_And_Name( DETID_ECAL , "ECAL");    geom->addDaughter(ecal);
305 >      FROG_Element_Base_With_DetId_And_Name* hcal    = new FROG_Element_Base_With_DetId_And_Name( DETID_HCAL , "HCAL");    geom->addDaughter(hcal);
306 >      FROG_Element_Base_With_DetId_And_Name* calo    = new FROG_Element_Base_With_DetId_And_Name( DETID_CALO , "Calo");    geom->addDaughter(calo);
307 >
308  
309  
310        // ### TRACKER GEOMETRY ###
# Line 293 | Line 361 | Frog_Analyzer::beginJob(const edm::Event
361           FEB        = tracker;
362  
363           Frog_DetId += SubDet*100000;
364 <         FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
364 >         FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
365           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
366 <         if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
366 > //         if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);}
367  
368           if(SubDet==PixelSubdetector::PixelBarrel){
369 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "PIB"); FEB_Temp->addDaughter(FEB);}
370 +
371              PXBDetId detid = PXBDetId(Detid);
372  
373              Frog_DetId += detid.layer()*10000;
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, "Layer%i", detid.layer() ); FEB_Temp->addDaughter(FEB);}
377  
378              Frog_DetId += detid.ladder()*100;
379 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
379 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
380              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
381 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
381 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ladder%i", detid.ladder() ); FEB_Temp->addDaughter(FEB);}
382           }else if(SubDet==PixelSubdetector::PixelEndcap){
383 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "PIE"); FEB_Temp->addDaughter(FEB);}
384 +
385              PXFDetId detid = PXFDetId(Detid);
386  
387              Frog_DetId += detid.side()*10000;
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, "Side%i",detid.side()); FEB_Temp->addDaughter(FEB);}
391  
392              Frog_DetId += detid.disk()*1000;
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, "Disk%i", detid.disk()); FEB_Temp->addDaughter(FEB);}
396  
397              Frog_DetId += detid.blade()*10;
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, "Blade%i", detid.blade()); FEB_Temp->addDaughter(FEB);}
401  
402              Frog_DetId += detid.panel()*1;
403 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
403 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
404              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
405 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
405 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Panel%i", detid.panel()); FEB_Temp->addDaughter(FEB);}
406           }else if(SubDet==StripSubdetector::TIB){
407 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TIB"); FEB_Temp->addDaughter(FEB);}
408 +
409              TIBDetId detid = TIBDetId(Detid);
410  
411              Frog_DetId += detid.layer()*10000;
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, "Layer%i", detid.layer()); FEB_Temp->addDaughter(FEB);}
415  
416              Frog_DetId += detid.stringNumber()*100;
417 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
417 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
418              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
419 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
419 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "String%i", detid.stringNumber()); FEB_Temp->addDaughter(FEB);}
420           }else if(SubDet==StripSubdetector::TID){
421 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TID"); FEB_Temp->addDaughter(FEB);}
422 +
423              TIDDetId detid = TIDDetId(Detid);
424  
425              Frog_DetId += detid.side()*10000;
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, "Slide%i", detid.side()); FEB_Temp->addDaughter(FEB);}
429  
430              Frog_DetId += detid.wheel()*1000;
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, "Wheel%i", detid.wheel()); FEB_Temp->addDaughter(FEB);}
434  
435              Frog_DetId += detid.ring()*10;
436 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
436 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
437              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
438 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
438 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
439           }else if(SubDet==StripSubdetector::TOB){
440 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TOB"); FEB_Temp->addDaughter(FEB);}
441 +
442              TOBDetId detid = TOBDetId(Detid);
443  
444              Frog_DetId += detid.layer()*10000;
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, "Layer%i",  detid.layer()); FEB_Temp->addDaughter(FEB);}
448  
449              Frog_DetId += detid.rodNumber()*100;
450 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
450 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
451              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
452 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
452 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Rod%i", detid.rodNumber()); FEB_Temp->addDaughter(FEB);}
453           }else if(SubDet==StripSubdetector::TEC){
454 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TEC"); FEB_Temp->addDaughter(FEB);}
455 +
456              TECDetId detid = TECDetId(Detid);
457  
458              Frog_DetId += detid.side()*10000;
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, "Side%i",detid.side()); FEB_Temp->addDaughter(FEB);}
462  
463              Frog_DetId += detid.wheel()*1000;
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, "Wheel%i", detid.wheel() ); FEB_Temp->addDaughter(FEB);}
467  
468              Frog_DetId += detid.ring()*10;
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, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
472  
473              Frog_DetId += detid.petalNumber();
474 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
474 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
475              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
476 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
476 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Petal%i", detid.petalNumber()); FEB_Temp->addDaughter(FEB);}
477           }else{
478              if(mod)delete mod;
479              continue;
# Line 468 | Line 548 | Frog_Analyzer::beginJob(const edm::Event
548           FEB        = muon;
549  
550           Frog_DetId += SubDet*100000;
551 <         FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
551 >         FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
552           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
553 <         if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
553 > //         if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);}
554  
555           if(SubDet==1){
556 <                DTChamberId detid = DTChamberId(Detid);
556 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "DT"); FEB_Temp->addDaughter(FEB);}
557 >
558 >            DTChamberId detid = DTChamberId(Detid);
559  
560              Frog_DetId += (detid.wheel()+3)*10000;
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, "Wheel%+i", detid.wheel()); FEB_Temp->addDaughter(FEB);}
564  
565              Frog_DetId += detid.station()*100;
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, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);}
569  
570              Frog_DetId += detid.sector()*1;
571 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
571 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
572              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
573 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
573 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Sector%i", detid.sector()); FEB_Temp->addDaughter(FEB);}
574           }else if(SubDet==2){
575 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "CSC"); FEB_Temp->addDaughter(FEB);}
576 +
577              CSCDetId detid = CSCDetId(Detid);
578    
579              Frog_DetId += detid.endcap()*10000;
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, "Side%i", detid.endcap()); FEB_Temp->addDaughter(FEB);}
583    
584              Frog_DetId += detid.station()*1000;
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, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);}
588    
589              Frog_DetId += detid.ring()*100;
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, "Ring%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
593  
594              Frog_DetId += detid.chamber()*1;
595 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
595 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
596              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
597 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
597 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Chamber%i", detid.chamber()); FEB_Temp->addDaughter(FEB);}
598           }else if(SubDet==3){
599 +            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "RPC"); FEB_Temp->addDaughter(FEB);}
600 +
601              RPCDetId detid = RPCDetId(Detid);
602  
603              Frog_DetId += (detid.region()+2)*10000;
604 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
604 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
605              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
606 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
606 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Region+%i", detid.region()); FEB_Temp->addDaughter(FEB);}
607  
608              // Barrel
609              if(detid.region()==0){
610                 Frog_DetId += (detid.ring()+3)*1000;
611 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
611 >               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
612                 FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
613 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
613 >               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring+%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
614              // Endcap
615              }else{
616                 Frog_DetId += detid.ring()*1000;
617 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
617 >               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
618                 FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
619 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
619 >               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Ring+%i", detid.ring()); FEB_Temp->addDaughter(FEB);}
620              }
621  
622              Frog_DetId += detid.station()*100;
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, "Station%i", detid.station()); FEB_Temp->addDaughter(FEB);}
626  
627              Frog_DetId += detid.sector()*1;
628 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
628 >            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
629              FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
630 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
630 >            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Sector%i", detid.sector()); FEB_Temp->addDaughter(FEB);}
631           }
632  
633           FEB->addDaughter(mod);
# Line 552 | Line 638 | Frog_Analyzer::beginJob(const edm::Event
638        // ### CALO GEOMETRY ###
639  
640        edm::ESHandle<CaloGeometry> CaloGeom;
641 <      iSetup.get<IdealGeometryRecord>().get( CaloGeom );
641 > //      iSetup.get<CaloGeometryRecord>().get( CaloGeom );
642 >      iSetup.get<CaloGeometryRecord>().get( CaloGeom );
643        const vector<DetId> CaloDets = CaloGeom->getValidDetIds();
644  
645        for(unsigned int i=0;i<CaloDets.size();i++)
# Line 560 | Line 647 | Frog_Analyzer::beginJob(const edm::Event
647           Detid  = CaloDets[i];
648           SubDet = Detid.subdetId();
649  
650 <         if(Detid.det()==DetId::Ecal){
651 <             if(SubDet<1 || SubDet>3) continue;
565 <
566 <            Frog_DetId = DETID_ECAL;
567 <            FEB        = ecal;
650 >                 if(Detid.det()==DetId::Ecal){
651 >                        if(SubDet<1 || SubDet>3) continue;
652  
653 <            Frog_DetId += SubDet*100000;
654 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
571 <            FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
572 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
653 >                        Frog_DetId = DETID_ECAL;
654 >                        FEB        = ecal;
655  
656 <            if(SubDet==1){
657 <               EBDetId detid = EBDetId(Detid);
658 <
659 <               Frog_DetId += ((detid.zside()==1)+1)*10000;
660 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
661 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
662 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
663 <
664 <               Frog_DetId += (detid.tower_ieta()*detid.zside())*100;
665 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
666 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
667 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
668 <
669 <               Frog_DetId += detid.tower_iphi()*1;
670 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
671 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
672 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
673 <            }else if(SubDet==2){
674 <               EEDetId detid = EEDetId(Detid);
656 >                        Frog_DetId += SubDet*100000;
657 >                        FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
658 >                        FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
659 > //                      if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId); FEB_Temp->addDaughter(FEB);}
660 >
661 >                        if(SubDet==1){
662 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "EB"); FEB_Temp->addDaughter(FEB);}
663 >
664 >                           EBDetId detid = EBDetId(Detid);
665 >
666 >                           Frog_DetId += ((detid.zside()==1)+1)*10000;
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, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
670 >
671 >                           Frog_DetId += (detid.tower_ieta()*detid.zside())*100;
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, "TowerIEta%+i", detid.tower_ieta()); FEB_Temp->addDaughter(FEB);}
675 >
676 >                           Frog_DetId += detid.tower_iphi()*1;
677 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
678 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
679 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "TowerIPhi%i", detid.tower_iphi()); FEB_Temp->addDaughter(FEB);}
680 >                        }else if(SubDet==2){
681 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "EE"); FEB_Temp->addDaughter(FEB);}
682 >
683 >                           EEDetId detid = EEDetId(Detid);
684 >
685 >                           Frog_DetId += ((detid.zside()==1)+1)*10000;
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, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
689 >
690 >                           Frog_DetId += detid.iquadrant()*1000;
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, "Quadran%i", detid.iquadrant()); FEB_Temp->addDaughter(FEB);}
694 >
695 >                           Frog_DetId += detid.isc();
696 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
697 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
698 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "ISC%i", detid.isc()); FEB_Temp->addDaughter(FEB);}
699 >                        }else if(SubDet==3){
700 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "ES"); FEB_Temp->addDaughter(FEB);}
701  
702 <               Frog_DetId += ((detid.zside()==1)+1)*10000;
595 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
596 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
597 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
598 <
599 <               Frog_DetId += detid.iquadrant()*1000;
600 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
601 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
602 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
603 <
604 <               Frog_DetId += detid.isc();
605 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
606 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
607 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
608 <            }else if(SubDet==3){
609 <               ESDetId detid = ESDetId(Detid);
702 >                           ESDetId detid = ESDetId(Detid);
703  
704 <               Frog_DetId += ((detid.zside()==1)+1)*10000;
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);}
704 >                           Frog_DetId += ((detid.zside()==1)+1)*10000;
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, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
708 >
709 >                           Frog_DetId += detid.plane()*1000;
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, "Plane%i", detid.plane()); FEB_Temp->addDaughter(FEB);}
713 >
714 >                           Frog_DetId += detid.six()*50;
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, "Six%i", detid.six()); FEB_Temp->addDaughter(FEB);}
718 >
719 >                           Frog_DetId += detid.siy();
720 >                           FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
721 >                           FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
722 >                           if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "Siy%i", detid.siy()); FEB_Temp->addDaughter(FEB);}
723 >                         }
724 >                 }else if(Detid.det()==DetId::Hcal){
725 >                        if(SubDet<1 || SubDet>4) continue;
726 >
727 >                        Frog_DetId = DETID_HCAL;
728 >                        FEB        = hcal;
729 >
730 >                        Frog_DetId += SubDet*100000;
731 >                        FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
732 >                        FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
733 >                        if(FEB==NULL){
734 >                                if(SubDet==1){   FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HB"); FEB_Temp->addDaughter(FEB);}
735 >                                if(SubDet==2){   FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HE"); FEB_Temp->addDaughter(FEB);}
736 >                                if(SubDet==3){   FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HO"); FEB_Temp->addDaughter(FEB);}
737 >                                if(SubDet==4){   FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "HF"); FEB_Temp->addDaughter(FEB);}
738 >                        }
739 >
740 >                        HcalDetId detid = HcalDetId(Detid);
741 >
742 >                        Frog_DetId += ((detid.zside()==1)+1)*10000;
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, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
746 >
747 >                        Frog_DetId += detid.ietaAbs()*100;
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, "IEta%+i", detid.ieta()); FEB_Temp->addDaughter(FEB);}
751 >
752 >                        Frog_DetId += detid.iphi()*1;
753 >                        FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
754 >                        FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
755 >                        if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IPhi%i", detid.iphi()); FEB_Temp->addDaughter(FEB);}
756  
757 <               Frog_DetId += detid.plane()*1000;
617 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
618 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
619 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
757 >                 }else if(Detid.det() == DetId::Calo){        
758  
759 <               Frog_DetId += detid.six()*50;
760 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
623 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
624 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
759 >                   Frog_DetId = DETID_CALO;
760 >                   FEB        = calo;
761  
762 <               Frog_DetId += detid.siy();
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 <         }else if(Detid.det()==DetId::Hcal){
632 <            if(SubDet<1 || SubDet>4) continue;
633 <
634 <            Frog_DetId = DETID_HCAL;
635 <            FEB        = hcal;
636 <
637 <            Frog_DetId += SubDet*100000;
638 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
639 <            FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
640 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
641 <
642 <            if(true){
643 <               HcalDetId detid = HcalDetId(Detid);
644 <
645 <               Frog_DetId += ((detid.zside()==1)+1)*10000;
646 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
647 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
648 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
649 <
650 <               Frog_DetId += detid.ietaAbs()*100;
651 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
652 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
653 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
654 <
655 <               Frog_DetId += detid.iphi()*1;
656 <               FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
657 <               FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
658 <               if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
659 <            }
660 <
661 <         }else if(Detid.det() == DetId::Calo){
662 <         continue;
663 <         /*
664 <            Frog_DetId = DETID_CALO + 1000000;
665 <            FEB        = hcal;
762 >                   if(SubDet!=(unsigned int)CaloTowerDetId::SubdetId)continue;
763  
764 <            Frog_DetId += SubDet*100000;
765 <            FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId*>(FEB);
766 <            FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
767 <            if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId(C_FEB_DETID, Frog_DetId); FEB_Temp->addDaughter(FEB);}
768 <         */
769 <         }
764 >                   Frog_DetId += SubDet*100000;
765 >                   FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
766 >                   FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
767 >                   if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "CaloTowers"); FEB_Temp->addDaughter(FEB);}
768 >
769 >                   if(SubDet==(unsigned int)CaloTowerDetId::SubdetId){
770 >                      CaloTowerDetId detid = CaloTowerDetId(Detid);
771 >
772 >                      Frog_DetId += ((detid.zside()==1)+1)*10000;
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, "Side%+i", detid.zside()); FEB_Temp->addDaughter(FEB);}
776 >
777 >                      Frog_DetId += (detid.ieta()*detid.zside())*100;
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, "IEta%+i", detid.ieta()); FEB_Temp->addDaughter(FEB);}
781 >
782 >                      Frog_DetId += detid.iphi()*1;
783 >                      FEB_Temp = dynamic_cast<FROG_Element_Base_With_DetId_And_Name*>(FEB);
784 >                      FEB = FEB_Temp->getDaughterWithDetId(Frog_DetId);
785 >                      if(FEB==NULL){FEB = new FROG_Element_Base_With_DetId_And_Name( Frog_DetId, "IPhi%i", detid.iphi()); FEB_Temp->addDaughter(FEB);}
786 >                   }
787 >                }
788  
789 <         const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid);
790 <         GlobalPoint CellPos =  CellGeom->getPosition();
791 <         const CaloCellGeometry::CornersVec CellCorners =  CellGeom->getCorners();
792 <
793 <         float cX = (CellCorners[0].x() + CellCorners[2].x())/2;
794 <         float cY = (CellCorners[0].y() + CellCorners[2].y())/2;
795 <         float cZ = (CellCorners[0].z() + CellCorners[2].z())/2;
796 <
797 <         float wX = (CellCorners[1].x() - CellCorners[0].x())/2;
798 <         float wY = (CellCorners[1].y() - CellCorners[0].y())/2;
799 <         float wZ = (CellCorners[1].z() - CellCorners[0].z())/2;
800 <        
801 <         float hX = (CellCorners[3].x() - CellCorners[0].x())/2;
802 <         float hY = (CellCorners[3].y() - CellCorners[0].y())/2;
803 <         float hZ = (CellCorners[3].z() - CellCorners[0].z())/2;
804 <
805 <         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) );
806 <               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) );
807 <
808 <         FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod(
809 <            Detid.rawId(), F,
810 <            cX  ,   cY  , cZ ,
811 <            wX  ,   wY  , wZ ,
812 <            hX  ,   hY  , hZ );
789 >                 const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid);
790 >                 GlobalPoint CellPos =  CellGeom->getPosition();
791 >                 const CaloCellGeometry::CornersVec CellCorners =  CellGeom->getCorners();
792 >
793 >                 float cX = (CellCorners[0].x() + CellCorners[2].x())/2;
794 >                 float cY = (CellCorners[0].y() + CellCorners[2].y())/2;
795 >                 float cZ = (CellCorners[0].z() + CellCorners[2].z())/2;
796 >
797 >                 float wX = (CellCorners[1].x() - CellCorners[0].x())/2;
798 >                 float wY = (CellCorners[1].y() - CellCorners[0].y())/2;
799 >                 float wZ = (CellCorners[1].z() - CellCorners[0].z())/2;
800 >                
801 >                 float hX = (CellCorners[3].x() - CellCorners[0].x())/2;
802 >                 float hY = (CellCorners[3].y() - CellCorners[0].y())/2;
803 >                 float hZ = (CellCorners[3].z() - CellCorners[0].z())/2;
804 >
805 >                 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) );
806 >                           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) );
807 >
808 >                 FROG_Element_Geom_CaloMod* mod = new FROG_Element_Geom_CaloMod(
809 >                        Detid.rawId(), F,
810 >                        cX  ,   cY  , cZ ,
811 >                        wX  ,   wY  , wZ ,
812 >                        hX  ,   hY  , hZ );
813  
814 <         FEB->addDaughter(mod);
814 >                 FEB->addDaughter(mod);  
815        }
816  
817        // ### Save .geom ###
818  
819        FROG_Geometry* CMS_Geom = new FROG_Geometry(prim);
820 <      CMS_Geom->Save("CMS.geom");  
820 >      CMS_Geom->Save("CMS.geom", CompressFiles);  
821 >      delete CMS_Geom;
822     }
823  
824 <   events_prim = new FROG_Element_Base(C_PRIMARY);  
824 >   events       = new FROG_Events();
825   }
826  
827   // ------------ method called once each job just after ending the event loop  ------------
# Line 715 | Line 831 | Frog_Analyzer::endJob()
831     if(NEvents>0){
832        char OutputFileName[1024];
833        sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str());
834 <      if(NEventsInVisFile>=0)sprintf(OutputFileName,"%s_R%i_E%i.vis",OutputFileName,SRun,SEvent);
834 >      if(NEventsInVisFile>=0){
835 >        sprintf(OutputFileName,"%s_%i",OutputFileName,FileIndex);
836 >        if(AddRunInfoInName)sprintf(OutputFileName,"%s_Run%i_1stEvent%08i",OutputFileName,SRun,SEvent);
837 >      }
838        sprintf(OutputFileName,"%s.vis",OutputFileName);
839  
840 <      FROG_Events* events = new FROG_Events(events_prim);
722 <      events->Save((char*) OutputFileName);
840 >      events->SaveInLive((char*) OutputFileName, true, CompressFiles);
841        delete events;
724      delete events_prim;
725
726      events_prim = new FROG_Element_Base(C_PRIMARY);
842        NEvents=0;
843     }
844   }
# Line 745 | Line 860 | Frog_Analyzer::analyze(const edm::Event&
860  
861  
862          FROG_Element_Event* event =  new FROG_Element_Event(iEvent.id().run(), iEvent.id().event(), iEvent.time().value() );
863 <        events_prim->addDaughter(event);
863 >        events->AddEvent(event);
864  
865          // access the tracker
866          edm::ESHandle<TrackerGeometry> tkGeom;
# Line 761 | Line 876 | Frog_Analyzer::analyze(const edm::Event&
876          iSetup.get<MuonGeometryRecord>().get( RpcGeom );
877  
878          edm::ESHandle<CaloGeometry> CaloGeom;
879 <        iSetup.get<IdealGeometryRecord>().get( CaloGeom );
879 >        iSetup.get<CaloGeometryRecord>().get( CaloGeom );
880 >
881 >
882 >        // ### GEN OBJECTS CONTAINER ###
883 >        FROG_Element_Base_With_DetId_And_Name* frogGen = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN, "GEN");
884 >        event->addDaughter(frogGen);
885  
886 +        // ### GENPARTICLES ###
887 +        FROG_Element_Base_With_DetId_And_Name* frogGenPartColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_GEN_CAND, "GenParticles");
888 +        frogGen->addDaughter(frogGenPartColl);
889 +
890 +
891 +        for(unsigned int i=0;i<GenParticlesProducers.size();i++){
892 +           edm::Handle<GenParticleCollection> h_gen_Particles;
893 +           iEvent.getByLabel(GenParticlesProducers[i], h_gen_Particles);
894 +           GenParticleCollection gen_Particles = *h_gen_Particles.product();
895 +
896 +           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());
897 +           frogGenPartColl->addDaughter(frogGenPartCollb);
898 +
899 +           for(unsigned int h=0;h<gen_Particles.size();h++){
900 +             if(gen_Particles[h].status()!=1)continue;
901 +             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());
902 +             frogGenPartCollb->addDaughter(frogGenPart);
903 +           }
904 +        }
905 +
906 +
907 +        // ### SIM OBJECTS CONTAINER ###
908 +        FROG_Element_Base_With_DetId_And_Name* frogSim = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIM, "SIM");
909 +        event->addDaughter(frogSim);
910  
911          // ### SIMTRACK ###
912 <        FROG_Element_Base_With_DetId* frogSimTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMTRK);
913 <        event->addDaughter(frogSimTrkColl);
912 >        FROG_Element_Base_With_DetId_And_Name* frogSimTrkColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMTRK, "SimTracks");
913 >        frogSim->addDaughter(frogSimTrkColl);
914  
915          for(unsigned int i=0;i<SimTrackProducers.size();i++){
916             edm::Handle<std::vector< SimTrack > > h_SimTracks;
# Line 785 | Line 929 | Frog_Analyzer::analyze(const edm::Event&
929          }
930  
931          // ### SIMVERTEX ###
932 <        FROG_Element_Base_With_DetId* frogSimVtx = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMVTX);
933 <        event->addDaughter(frogSimVtx);
932 >        FROG_Element_Base_With_DetId_And_Name* frogSimVtx = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMVTX, "SimVertex");
933 >        frogSim->addDaughter(frogSimVtx);
934  
935          for(unsigned int i=0;i<SimVertexProducers.size();i++){
936             edm::Handle<std::vector< SimVertex > > h_Vertex;
# Line 807 | Line 951 | Frog_Analyzer::analyze(const edm::Event&
951  
952          // ### SIMHIT ###
953  
954 <        FROG_Element_Base_With_DetId* frogSimHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMHIT);
955 <        event->addDaughter(frogSimHit);
954 >        FROG_Element_Base_With_DetId_And_Name* frogSimHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_SIMHIT, "SimHits");
955 >        frogSim->addDaughter(frogSimHit);
956          for(unsigned int i=0;i<SimHitProducers.size();i++){
957             edm::Handle<std::vector< PSimHit > > h_Hits;
958             iEvent.getByLabel(SimHitProducers[i], h_Hits);
959             std::vector< PSimHit > Hits = *h_Hits.product();
960  
961 <           FROG_Element_Base_With_DetId* frogSimHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMHIT + i + 1);
961 >           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() );
962             frogSimHit->addDaughter(frogSimHitColl);
963  
964             for(unsigned int h=0; h<Hits.size(); h++)
# Line 841 | Line 985 | Frog_Analyzer::analyze(const edm::Event&
985             iEvent.getByLabel(SimCaloHitProducers[i], h_CaloHits);
986             std::vector< PCaloHit > CaloHits = *h_CaloHits.product();
987  
988 <           FROG_Element_Base_With_DetId* frogSimHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_SIMHIT + SimHitProducers.size() + i + 1);
988 >           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());
989             frogSimHit->addDaughter(frogSimHitColl);
990  
991             for(unsigned int h=0; h<CaloHits.size(); h++)
# Line 859 | Line 1003 | Frog_Analyzer::analyze(const edm::Event&
1003             }
1004          }
1005  
862        // NUCLEAR INTERACTIONS
863        for(unsigned int i=0;i<NIProducers.size();i++) {
864          edm::Handle<std::vector<reco::NuclearInteraction> > h_NIs;
865          iEvent.getByLabel(NIProducers[i], h_NIs);
866          std::vector<reco::NuclearInteraction> NIs = *h_NIs.product();
867          FROG_Element_Base_With_DetId* frogNIColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_NUCLINT + i);
868          event->addDaughter(frogNIColl);
1006  
870          for(unsigned int h=0; h<NIs.size();h++){
871             reco::NuclearInteraction ni = NIs[i];
872             float vtx_x = ni.vertex().x();
873             float vtx_y = ni.vertex().y();
874             float vtx_z = ni.vertex().z();
875             float like  = ni.likelihood();
876             FROG_Element_Event_NuclInt*  frogNI = new FROG_Element_Event_NuclInt(vtx_x, vtx_y, vtx_z, like );
877             frogNIColl->addDaughter(frogNI);
878          }
879        }
1007  
1008  
1009 +        // ### LOW RECO OBJECTS CONTAINER ###
1010 +        FROG_Element_Base_With_DetId_And_Name* frogLowReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_LOWRECO, "RECO LOW");
1011 +        event->addDaughter(frogLowReco);
1012  
883        // ### TRAJECTORY ###
884        FROG_Element_Base_With_DetId* frogTrk = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK);
885        event->addDaughter(frogTrk);
1013  
887        for(unsigned int i=0;i<TrajectoryProducers.size();i++){
888             Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle;
889             iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle);
890             const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product();
1014  
1015 <             FROG_Element_Base_With_DetId* frogTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK + i + 1);
1016 <             frogTrk->addDaughter(frogTrkColl);
1015 >        // ### SiStrip Clusters ###
1016 >        FROG_Element_Base_With_DetId_And_Name* frogSSTHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_SISTRIPCLUSTER, "SiStrip Clusters");
1017 >        frogLowReco->addDaughter(frogSSTHit);
1018 >        for(unsigned int i=0;i<SiStripClusterProducers.size();i++){
1019 >           edm::Handle<edmNew::DetSetVector<SiStripCluster> > h_Sst_Hits;
1020 >           iEvent.getByLabel(SiStripClusterProducers[i], h_Sst_Hits);
1021 >           const edmNew::DetSetVector<SiStripCluster>&  Sst_Hits = *h_Sst_Hits.product();
1022  
895             for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) {
896                Trajectory  recoTraj     = *it->key;
897                FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(i,it->val->p(),it->val->pt(),it->key->chiSquared());
898                frogTrkColl->addDaughter(frogTrk);
1023  
1024 <                std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements();
1025 <                for(unsigned int h=0;h<measurements.size();h++){
1024 >           FROG_Element_Base_With_DetId_And_Name* frogSstHitColl = new FROG_Element_Base_With_DetId_And_Name( EVTID_SISTRIPCLUSTER + i + 1, SiStripClusterProducers[i].encode().c_str());
1025 >           frogSSTHit->addDaughter(frogSstHitColl);
1026  
903                      TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit();
904                      if(!h_it->isValid() )continue;
905                      DetId detId                = h_it->geographicalId();
906                      GlobalPoint globalPos      = measurements[h].updatedState().globalPosition();
1027  
1028 <                      FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(detId.rawId(), globalPos.x(),globalPos.y(),  globalPos.z(), -1);
1029 <                      frogTrk->addDaughter(frogHit);
1030 <                }
1031 <           }
912 <        }
1028 >           for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter = Sst_Hits.begin(); DSViter != Sst_Hits.end(); ++DSViter) {
1029 >           edmNew::DetSet<SiStripCluster>::const_iterator begin=DSViter->begin();
1030 >           edmNew::DetSet<SiStripCluster>::const_iterator end  =DSViter->end();
1031 >           for(edmNew::DetSet<SiStripCluster>::const_iterator iCluster=begin;iCluster!=end;++iCluster){
1032  
1033 <        // ### TRACK ###
1033 >                const GeomDetUnit* detUnit = tkGeom->idToDetUnit (DetId( iCluster->geographicalId() ) );
1034 >                if(!detUnit)continue;
1035  
1036 <        for(unsigned int i=0;i<TrackProducers.size();i++){
1037 <           edm::Handle<std::vector< reco::Track > > h_Tracks;
918 <           iEvent.getByLabel(TrackProducers[i], h_Tracks);
919 <           std::vector< reco::Track > TrackColl = *h_Tracks.product();
1036 >                const StripGeomDetUnit* DetUnit = dynamic_cast<const StripGeomDetUnit*> ( detUnit  );
1037 >                if(!DetUnit)continue;
1038  
1039 <           FROG_Element_Base_With_DetId* frogTrkColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_TRK + TrajectoryProducers.size() + i + 1);
922 <           frogTrk->addDaughter(frogTrkColl);
1039 >                const StripTopology& Topo  = DetUnit->specificTopology();
1040  
1041 <           //printf("Size of the TrackCOllection : %i = %i\n",i,TrackColl.size());
1042 <           for ( unsigned int t = 0; t < TrackColl.size(); ++t ) {
926 <              reco::Track  recoTrack  =TrackColl[t];
1041 >                unsigned int Charge = 0;
1042 >                for(unsigned int i=0;i<iCluster->amplitudes().size();i++){Charge+=iCluster->amplitudes()[i];}
1043  
1044 <              FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(TrajectoryProducers.size()+i,recoTrack.p(),recoTrack.pt(), recoTrack.chi2());
929 <              frogTrkColl->addDaughter(frogTrk);
1044 >                unsigned int MiddleStrip = iCluster->firstStrip() + iCluster->amplitudes().size()/2;
1045  
1046 <              for(unsigned int h=0;h<recoTrack.recHitsSize();h++){
1047 <                 TrackingRecHitRef h_it     = recoTrack.recHit(h);
1048 <                 if(!h_it->isValid() )continue;
1049 <                 DetId detId                = h_it->geographicalId();
935 <                 const GeomDet * theDet = NULL;
1046 >                float Pitch = DetUnit->surface().bounds().width() / Topo.nstrips();
1047 >                float XPos = (MiddleStrip * Pitch) - DetUnit->surface().bounds().width()/2;
1048 >                //float YPos = DetUnit->surface().bounds().thickness()/2;
1049 >                //float ZPos = DetUnit->surface().bounds().length()/2;
1050  
1051 <                 if(detId.det()==DetId::Tracker)                        theDet = tkGeom->idToDet(detId);
938 <                 if(detId.det()==DetId::Muon && detId.subdetId() == 1)  theDet = DtGeom->idToDet(detId);
939 <                 if(detId.det()==DetId::Muon && detId.subdetId() == 2)  theDet = CscGeom->idToDet(detId);
940 <                 if(detId.det()==DetId::Muon && detId.subdetId() == 3)  theDet = RpcGeom->idToDet(detId);
1051 >                Surface::GlobalPoint Pos  = DetUnit->surface().toGlobal( LocalPoint(XPos, 0, 0) );
1052  
942                 LocalPoint localPos        = h_it->localPosition();
1053  
1054 <                 FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(
1055 <                        detId.rawId(),
1056 <                        theDet->surface().toGlobal(localPos).x(),
1057 <                        theDet->surface().toGlobal(localPos).y(),
1058 <                        theDet->surface().toGlobal(localPos).z(),
949 <                        -1);
950 <                 frogTrk->addDaughter(frogHit);
951 <              }
952 <           }
1054 >                FROG_Element_Event_Cluster_SiStrip* frogStripClust = new FROG_Element_Event_Cluster_SiStrip(iCluster->geographicalId(), iCluster->firstStrip(), Pitch);
1055 >                for(unsigned int i=0;i<iCluster->amplitudes().size();i++){frogStripClust->Ampl_.push_back(iCluster->amplitudes()[i]);}
1056 >                frogSstHitColl->addDaughter(frogStripClust);
1057 >           }}
1058 >
1059          }
1060  
1061  
1062 +
1063 +        // ### CALORecHits ###
1064 +        FROG_Element_Base_With_DetId_And_Name* frogCaloHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_CALOHIT, "CALO Hits");
1065 +        frogLowReco->addDaughter(frogCaloHit);
1066 +
1067 +
1068          // ### ECALRecHits ###
1069 <        FROG_Element_Base_With_DetId* frogEcalHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_ECALHIT);
1070 <        event->addDaughter(frogEcalHit);
1069 >        FROG_Element_Base_With_DetId_And_Name* frogEcalHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_ECALHIT, "ECAL RecHits");
1070 >        frogCaloHit->addDaughter(frogEcalHit);
1071          for(unsigned int i=0;i<EcalRecHitProducers.size();i++){
1072             edm::Handle<EcalRecHitCollection > h_Ecal_RecHits;
1073             iEvent.getByLabel(EcalRecHitProducers[i], h_Ecal_RecHits);
1074             EcalRecHitCollection Ecal_RecHits = *h_Ecal_RecHits.product();
1075  
1076 <           FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_ECALHIT + i + 1);
1076 >           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());
1077             frogEcalHit->addDaughter(frogHitColl);
1078  
1079             for(unsigned int eh=0;eh<Ecal_RecHits.size();eh++){
# Line 973 | Line 1085 | Frog_Analyzer::analyze(const edm::Event&
1085  
1086  
1087          // ### HCALRecHits ###
1088 <        FROG_Element_Base_With_DetId* frogHcalHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT);
1089 <        event->addDaughter(frogHcalHit);
1088 >        FROG_Element_Base_With_DetId_And_Name* frogHcalHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_HCALHIT, "HCAL RecHits");
1089 >        frogCaloHit->addDaughter(frogHcalHit);
1090          for(unsigned int i=0;i<HcalHBHERecHitProducers.size();i++){
1091             edm::Handle<HBHERecHitCollection > h_HcalHBHE_RecHits;
1092             iEvent.getByLabel(HcalHBHERecHitProducers[i], h_HcalHBHE_RecHits);
1093             HBHERecHitCollection HcalHBHE_RecHits = *h_HcalHBHE_RecHits.product();
1094  
1095 <           FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + i + 1);
1095 >           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());
1096             frogHcalHit->addDaughter(frogHitColl);
1097  
1098             for(unsigned int hh=0;hh<HcalHBHE_RecHits.size();hh++){
# Line 995 | Line 1107 | Frog_Analyzer::analyze(const edm::Event&
1107             iEvent.getByLabel(HcalHORecHitProducers[i], h_HcalHO_RecHits);
1108             HORecHitCollection HcalHO_RecHits = *h_HcalHO_RecHits.product();
1109  
1110 <           FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + HcalHBHERecHitProducers.size() + i + 1);
1110 >           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());
1111             frogHcalHit->addDaughter(frogHitColl);
1112  
1113             for(unsigned int hh=0;hh<HcalHO_RecHits.size();hh++){
# Line 1010 | Line 1122 | Frog_Analyzer::analyze(const edm::Event&
1122             iEvent.getByLabel(HcalHFRecHitProducers[i], h_HcalHF_RecHits);
1123             HFRecHitCollection HcalHF_RecHits = *h_HcalHF_RecHits.product();
1124  
1125 <           FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_HCALHIT + HcalHBHERecHitProducers.size() + HcalHORecHitProducers.size() + i + 1);
1125 >           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());
1126             frogHcalHit->addDaughter(frogHitColl);
1127  
1128             for(unsigned int hh=0;hh<HcalHF_RecHits.size();hh++){
# Line 1022 | Line 1134 | Frog_Analyzer::analyze(const edm::Event&
1134  
1135  
1136          // ### Muon Segments ###
1137 <        FROG_Element_Base_With_DetId* frogMuonSeg = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG);
1138 <        event->addDaughter(frogMuonSeg);
1137 >        FROG_Element_Base_With_DetId_And_Name* frogMuonSeg = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONSEG, "MuonSegments");
1138 >        frogLowReco->addDaughter(frogMuonSeg);
1139  
1140          for(unsigned int i=0;i<CSCSegmentProducers.size();i++){
1141             edm::Handle<CSCSegmentCollection > h_CSC_Segments;
1142             iEvent.getByLabel(CSCSegmentProducers[i], h_CSC_Segments);
1143             CSCSegmentCollection CSC_Segments = *h_CSC_Segments.product();
1144  
1145 <           FROG_Element_Base_With_DetId* frogSegColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG + i + 1);
1145 >           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());
1146             frogMuonSeg->addDaughter(frogSegColl);
1147  
1148             for(unsigned int s=0;s<CSC_Segments.size();s++){
# Line 1049 | Line 1161 | Frog_Analyzer::analyze(const edm::Event&
1161             iEvent.getByLabel(DTSegmentProducers[i], h_DT_Segments);
1162             DTRecSegment4DCollection DT_Segments = *h_DT_Segments.product();
1163  
1164 <           FROG_Element_Base_With_DetId* frogSegColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONSEG + CSCSegmentProducers.size() + i + 1);
1164 >           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());
1165             frogMuonSeg->addDaughter(frogSegColl);
1166  
1167             for(unsigned int s=0;s<DT_Segments.size();s++){
# Line 1064 | Line 1176 | Frog_Analyzer::analyze(const edm::Event&
1176          }
1177  
1178          // ### Muon Hits ###
1179 <        FROG_Element_Base_With_DetId* frogMuonHit = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONHIT);
1180 <        event->addDaughter(frogMuonHit);
1179 >        FROG_Element_Base_With_DetId_And_Name* frogMuonHit = new FROG_Element_Base_With_DetId_And_Name( EVTID_MUONHIT, "MuonHits");
1180 >        frogLowReco->addDaughter(frogMuonHit);
1181          for(unsigned int i=0;i<RPCHitsProducers.size();i++){
1182             edm::Handle<RPCRecHitCollection > h_RPC_Hits;
1183             iEvent.getByLabel(RPCHitsProducers[i], h_RPC_Hits);
1184             RPCRecHitCollection RPC_Hits = *h_RPC_Hits.product();
1185  
1186 <           FROG_Element_Base_With_DetId* frogHitColl = new FROG_Element_Base_With_DetId(C_FEB_DETID, EVTID_MUONHIT + i + 1);
1186 >           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());
1187             frogMuonHit->addDaughter(frogHitColl);
1188  
1189             for(unsigned int h=0;h<RPC_Hits.size();h++){
# Line 1085 | Line 1197 | Frog_Analyzer::analyze(const edm::Event&
1197          }
1198  
1199  
1200 +        // ### Calo Towers ###
1201 +        FROG_Element_Base_With_DetId_And_Name* frogCaloTower = new FROG_Element_Base_With_DetId_And_Name( EVTID_CALOTOWER, "CaloTowers");
1202 +        frogLowReco->addDaughter(frogCaloTower);
1203 +        for(unsigned int i=0;i<CaloTowersProducers.size();i++){
1204 +           edm::Handle<CaloTowerCollection> h_Calo_Towers;
1205 +           iEvent.getByLabel(CaloTowersProducers[i], h_Calo_Towers);
1206 +           CaloTowerCollection Calo_Towers = *h_Calo_Towers.product();
1207 +
1208 +           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());
1209 +           frogCaloTower->addDaughter(frogCaloTowerColl);
1210 +
1211 +           for(unsigned int h=0;h<Calo_Towers.size();h++){
1212 +                FROG_Element_Event_CaloTower* frogTower = new FROG_Element_Event_CaloTower(Calo_Towers[h].id().rawId(), Calo_Towers[h].emEnergy(),Calo_Towers[h].hadEnergy());
1213 +                frogCaloTowerColl->addDaughter(frogTower);
1214 +
1215 +                if(i==0 && CaloTowersProducersBasedOnCaloHits){
1216 +                   frogTower->Components_CollEvtId_ = EVTID_CALOHIT;
1217 +
1218 +
1219 +                     for(unsigned int D=0;D<Calo_Towers[h].constituentsSize();D++){frogTower->Components_Vector_.push_back(Calo_Towers[h].constituent(D));}                  
1220 +
1221 + //                   std::vector<DetId> TowersDetIds = Calo_Towers[h].constituents();
1222 + //                   for(unsigned int D=0;D<TowersDetIds.size();D++){frogTower->Components_Vector_.push_back(TowersDetIds[D]);}
1223 +                }
1224 +
1225 +           }
1226 +        }
1227 +
1228 +
1229 +
1230 +        // ### MED RECO OBJECTS CONTAINER ###
1231 +        FROG_Element_Base_With_DetId_And_Name* frogMedReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_MEDRECO, "RECO MED");
1232 +        event->addDaughter(frogMedReco);
1233 +
1234 +
1235 +
1236 +
1237 +
1238 +        FROG_Element_Base_With_DetId_And_Name* frogNIVertex = new FROG_Element_Base_With_DetId_And_Name( EVTID_NUCLINT, "Vertex from NI");
1239 +        frogMedReco->addDaughter(frogNIVertex);
1240 +
1241 +        // NUCLEAR INTERACTIONS
1242 +        for(unsigned int i=0;i<NIProducers.size();i++) {
1243 +          edm::Handle<std::vector<reco::NuclearInteraction> > h_NIs;
1244 +          iEvent.getByLabel(NIProducers[i], h_NIs);
1245 +          std::vector<reco::NuclearInteraction> NIs = *h_NIs.product();
1246 +          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());
1247 +          frogNIVertex->addDaughter(frogNIColl);
1248 +
1249 +          for(unsigned int h=0; h<NIs.size();h++){
1250 +             reco::NuclearInteraction ni = NIs[i];
1251 +             float vtx_x = ni.vertex().x();
1252 +             float vtx_y = ni.vertex().y();
1253 +             float vtx_z = ni.vertex().z();
1254 +             float like  = ni.likelihood();
1255 +             FROG_Element_Event_NuclInt*  frogNI = new FROG_Element_Event_NuclInt(vtx_x, vtx_y, vtx_z, like );
1256 +             frogNIColl->addDaughter(frogNI);
1257 +          }
1258 +        }
1259 +
1260 +
1261 +
1262 +        // ### TRAJECTORY ###
1263 +        FROG_Element_Base_With_DetId_And_Name* frogTrk = new FROG_Element_Base_With_DetId_And_Name( EVTID_TRK, "Tracks & Trajectories");
1264 +        frogMedReco->addDaughter(frogTrk);
1265 +
1266 +        for(unsigned int i=0;i<TrajectoryProducers.size();i++){
1267 +             Handle<TrajTrackAssociationCollection> trajTrackAssociationHandle;
1268 +             iEvent.getByLabel(TrajectoryProducers[i], trajTrackAssociationHandle);
1269 +             const TrajTrackAssociationCollection TrajToTrackMap = *trajTrackAssociationHandle.product();
1270 +
1271 +             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());
1272 +             frogTrk->addDaughter(frogTrkColl);
1273 +
1274 +             for(TrajTrackAssociationCollection::const_iterator it = TrajToTrackMap.begin(); it!=TrajToTrackMap.end(); ++it) {
1275 +                Trajectory  recoTraj     = *it->key;
1276 +                FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(i,it->val->p(),it->val->pt(),it->key->chiSquared());
1277 +                frogTrkColl->addDaughter(frogTrk);
1278 +
1279 +                std::vector<TrajectoryMeasurement> measurements = recoTraj.measurements();
1280 +                for(unsigned int h=0;h<measurements.size();h++){
1281 +
1282 +                      TrajectoryMeasurement::ConstRecHitPointer h_it = measurements[h].recHit();
1283 +                      if(!h_it->isValid() )continue;
1284 +                      DetId detId                = h_it->geographicalId();
1285 +                      GlobalPoint globalPos      = measurements[h].updatedState().globalPosition();
1286 +
1287 +                      FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(detId.rawId(), globalPos.x(),globalPos.y(),  globalPos.z(), -1);
1288 +                      frogTrk->addDaughter(frogHit);
1289 +                }
1290 +              //  printf("Add a Trajectory\n");
1291 +           }
1292 +        }
1293 +
1294 +
1295 +
1296 +
1297 +        // ### TRACK ###
1298 +
1299 +        for(unsigned int i=0;i<TrackProducers.size();i++){
1300 +           edm::Handle<std::vector< reco::Track > > h_Tracks;
1301 +           iEvent.getByLabel(TrackProducers[i], h_Tracks);
1302 +           std::vector< reco::Track > TrackColl = *h_Tracks.product();
1303 +
1304 +           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());
1305 +           frogTrk->addDaughter(frogTrkColl);
1306 +
1307 +           //printf("Size of the TrackCOllection : %i = %i\n",i,TrackColl.size());
1308 +           for ( unsigned int t = 0; t < TrackColl.size(); ++t ) {
1309 +              reco::Track  recoTrack  =TrackColl[t];
1310 +
1311 +              FROG_Element_Event_Track* frogTrk = new FROG_Element_Event_Track(TrajectoryProducers.size()+i,recoTrack.p(),recoTrack.pt(), recoTrack.chi2());
1312 +              frogTrkColl->addDaughter(frogTrk);
1313 +
1314 +              for(unsigned int h=0;h<recoTrack.recHitsSize();h++){
1315 +                 TrackingRecHitRef h_it     = recoTrack.recHit(h);
1316 +                 if(!h_it->isValid() )continue;
1317 +                 DetId detId                = h_it->geographicalId();
1318 +                 const GeomDet * theDet = NULL;
1319 +
1320 +                 if(detId.det()==DetId::Tracker)                        theDet = tkGeom->idToDet(detId);
1321 +                 if(detId.det()==DetId::Muon && detId.subdetId() == 1)  theDet = DtGeom->idToDet(detId);
1322 +                 if(detId.det()==DetId::Muon && detId.subdetId() == 2)  theDet = CscGeom->idToDet(detId);
1323 +                 if(detId.det()==DetId::Muon && detId.subdetId() == 3)  theDet = RpcGeom->idToDet(detId);
1324 +
1325 +                 LocalPoint localPos        = h_it->localPosition();
1326 +
1327 +                 FROG_Element_Event_Hit* frogHit = new FROG_Element_Event_Hit(
1328 +                        detId.rawId(),
1329 +                        theDet->surface().toGlobal(localPos).x(),
1330 +                        theDet->surface().toGlobal(localPos).y(),
1331 +                        theDet->surface().toGlobal(localPos).z(),
1332 +                        -1);
1333 +                 frogTrk->addDaughter(frogHit);
1334 +              }
1335 +              //printf("Add a Track\n");
1336 +
1337 +           }
1338 +        }
1339 +
1340 +
1341 +
1342 +
1343 +
1344 +
1345 +        // ### HIGH RECO OBJECTS CONTAINER ###
1346 +        FROG_Element_Base_With_DetId_And_Name* frogHighReco = new FROG_Element_Base_With_DetId_And_Name( EVTID_HIGHRECO, "RECO HIGH");
1347 +        event->addDaughter(frogHighReco);
1348 +
1349 +
1350 +
1351 +        FROG_Element_Base_With_DetId_And_Name* frogJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET, "Jets");
1352 +        frogHighReco->addDaughter(frogJet);
1353 +
1354 +
1355 +        // ### Basic Jets ###
1356 +        FROG_Element_Base_With_DetId_And_Name* frogBasicJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_BASIC, "BasicJets");
1357 +        frogJet->addDaughter(frogBasicJet);
1358 +        for(unsigned int i=0;i<BasicJetsProducers.size();i++){
1359 +           edm::Handle<BasicJetCollection> h_Basic_Jets;
1360 +           iEvent.getByLabel(BasicJetsProducers[i], h_Basic_Jets);
1361 +           BasicJetCollection Basic_Jets = *h_Basic_Jets.product();
1362 +
1363 +           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());
1364 +           frogBasicJet->addDaughter(frogBasicJetColl);
1365 +
1366 +           for(unsigned int h=0;h<Basic_Jets.size();h++){
1367 +                FROG_Element_Event_Jet* frogJet = new FROG_Element_Event_Jet(Basic_Jets[h].p(), Basic_Jets[h].eta(),Basic_Jets[h].phi());
1368 +                frogBasicJet->addDaughter(frogJet);
1369 +           }
1370 +        }
1371 +
1372 +
1373 +        // ### Calo Jets ###
1374 +        FROG_Element_Base_With_DetId_And_Name* frogCaloJet = new FROG_Element_Base_With_DetId_And_Name( EVTID_JET_CALO, "CaloJets");
1375 +        frogJet->addDaughter(frogCaloJet);
1376 +        for(unsigned int i=0;i<CaloJetsProducers.size();i++){
1377 +           edm::Handle<CaloJetCollection> h_Calo_Jets;
1378 +           iEvent.getByLabel(CaloJetsProducers[i], h_Calo_Jets);
1379 +           CaloJetCollection Calo_Jets = *h_Calo_Jets.product();
1380 +
1381 +           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());
1382 +           frogCaloJet->addDaughter(frogCaloJetColl);
1383 +
1384 +           for(unsigned int h=0;h<Calo_Jets.size();h++){
1385 +                FROG_Element_Event_Jet* frogJet = new FROG_Element_Event_Jet(Calo_Jets[h].p(), Calo_Jets[h].eta(),Calo_Jets[h].phi());
1386 +                frogCaloJetColl->addDaughter(frogJet);
1387 +
1388 +                if(CaloJetsProducersBasedOnCaloTowers){
1389 +
1390 +                   std::vector<CaloTowerPtr> CaloTowers = Calo_Jets[h].getCaloConstituents();
1391 +                   frogJet->Components_CollEvtId_ = EVTID_CALOTOWER + 1;
1392 +                   for(unsigned int t=0;t<CaloTowers.size();t++){  frogJet->Components_Vector_.push_back(CaloTowers[t]->id().rawId());}
1393 +                }
1394 +           }
1395 +        }
1396 +
1397 +        // ### MET ###
1398 +        FROG_Element_Base_With_DetId_And_Name* frogMET = new FROG_Element_Base_With_DetId_And_Name( EVTID_MET_CALO, "MET");
1399 +        frogHighReco->addDaughter(frogMET);
1400 +        for(unsigned int i=0;i<CaloMETProducers.size();i++){
1401 +           edm::Handle<CaloMETCollection> h_met;
1402 +           iEvent.getByLabel(CaloMETProducers[i], h_met);
1403 +           CaloMETCollection reco_met = *h_met.product();
1404 +
1405 +           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());
1406 +           frogMET->addDaughter(frogMETColl);
1407 +
1408 +           for(unsigned int h=0;h<reco_met.size();h++){
1409 +                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());
1410 +                frogMETColl->addDaughter(frogMETevt);
1411 +           }
1412 +        }
1413 +
1414 +
1415 +        // ### RecoCandidates ###
1416 +        FROG_Element_Base_With_DetId_And_Name* frogRecoCand = new FROG_Element_Base_With_DetId_And_Name( EVTID_RECOCAND, "RecoCandidates");
1417 +        frogHighReco->addDaughter(frogRecoCand);
1418 +        for(unsigned int i=0;i<RecoCandidateProducers.size();i++){
1419 +           edm::Handle<CandidateCollection> h_reco_Candidates;
1420 +           iEvent.getByLabel(RecoCandidateProducers[i], h_reco_Candidates);
1421 +           CandidateCollection reco_Candidates = *h_reco_Candidates.product();
1422 +
1423 +           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());
1424 +           frogRecoCand->addDaughter(frogRecoCandColl);
1425 +
1426 +           for(unsigned int h=0;h<reco_Candidates.size();h++){
1427 +                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());
1428 +                frogRecoCandColl->addDaughter(frogCandidate);
1429 +           }
1430 +        }
1431 +
1432 +
1433 +
1434     NEvents++;
1435 +
1436 +   char OutputFileName[1024];
1437 +   sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str());
1438 +     if(NEventsInVisFile>=0){
1439 +     sprintf(OutputFileName,"%s_%i",OutputFileName,FileIndex);
1440 +     if(AddRunInfoInName)sprintf(OutputFileName,"%s_Run%i_1stEvent%08i",OutputFileName,SRun,SEvent);
1441 +   }
1442 +   sprintf(OutputFileName,"%s.vis",OutputFileName);
1443 +   events->SaveInLive((char*) OutputFileName, false, CompressFiles, (unsigned int)-1);
1444 +
1445     if(NEvents == NEventsInVisFile){
1446 <      char OutputFileName[1024];
1447 <      sprintf(OutputFileName,"%s",OutputFile.substr(0,OutputFile.size()-4).c_str());
1092 <      if(NEventsInVisFile>=0)sprintf(OutputFileName,"%s_R%i_E%i.vis",OutputFileName,SRun,SEvent);
1093 <      sprintf(OutputFileName,"%s.vis",OutputFileName);
1446 >      events->SaveInLive((char*) OutputFileName, true, CompressFiles, (unsigned int)-1);
1447 >      FileIndex++;
1448  
1095      FROG_Events* events = new FROG_Events(events_prim);
1096      events->Save((char*) OutputFileName);
1449        delete events;
1450 <      delete events_prim;
1099 <
1100 <      events_prim = new FROG_Element_Base(C_PRIMARY);
1450 >      events      = new FROG_Events();
1451        NEvents=0;
1452     }
1103
1453   }
1454  
1455  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines