Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:02

0001 //////////////////////////////
0002 // Geometry Checklist       //
0003 // Properties of Pt-Modules //
0004 //                          //
0005 // Nicola Pozzobon - 2011   //
0006 //////////////////////////////
0007 
0008 #include "FWCore/Framework/interface/MakerMacros.h"
0009 #include "FWCore/Framework/interface/EDAnalyzer.h"
0010 #include "FWCore/Framework/interface/Event.h"
0011 #include "FWCore/Framework/interface/ESHandle.h"
0012 #include "FWCore/PluginManager/interface/ModuleDef.h"
0013 #include "FWCore/ServiceRegistry/interface/Service.h"
0014 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0015 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0016 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h"
0017 #include "Geometry/TrackerGeometryBuilder/interface/RectangularPixelTopology.h"
0018 #include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
0019 #include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
0020 #include "CommonTools/UtilAlgos/interface/TFileService.h"
0021 #include <TH2D.h>
0022 #include <TH1D.h>
0023 #include <fstream>
0024 
0025 //////////////////////////////
0026 //                          //
0027 //     CLASS DEFINITION     //
0028 //                          //
0029 //////////////////////////////
0030 
0031 class AnalyzerPrintGeomInfo : public edm::EDAnalyzer {
0032   /// Public methods
0033 public:
0034   /// Constructor/destructor
0035   explicit AnalyzerPrintGeomInfo(const edm::ParameterSet& iConfig);
0036   virtual ~AnalyzerPrintGeomInfo();
0037   // Typical methods used on Loops over events
0038   virtual void beginJob();
0039   virtual void endJob();
0040   virtual void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup);
0041 
0042   /// Private methods and variables
0043 private:
0044   std::string TextOutput;
0045   bool DebugMode;
0046 
0047   bool testedGeometry;
0048   bool debugPrintouts;
0049 
0050   /// Output file
0051   std::ofstream outputFile;
0052 
0053   /// Containers of parameters passed by python
0054   /// configuration file
0055   edm::ParameterSet config;
0056 
0057   /// Histograms
0058   TH2D* hPXB_Lay_R;
0059   std::map<unsigned int, TH2D*> mapPXB2Lay_hPXB_Lad_Mod;
0060   std::map<unsigned int, TH2D*> mapPXB2Lay_hPXB_Lad_Phi;
0061   std::map<unsigned int, TH2D*> mapPXB2Lay_hPXB_Mod_Z;
0062   std::map<unsigned int, TH2D*> mapPXB2Lay_hPXB_Lad_R;
0063   std::map<unsigned int, TH2D*> mapPXB2Lay_hPXB_Mod_R;
0064   std::map<unsigned int, TH1D*> mapPXB2Lay_hPXB_R;
0065 
0066   TH2D* hPXF_Disk00_Disk;
0067   TH2D* hPXF_Disk00_Side;
0068   TH2D* hPXF_Disk00_Z;
0069   TH2D* hPXF_Disk00_R;
0070   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Pan_Mod;
0071   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Bla_Mod;
0072   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Bla_Pan;
0073   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Pan_R;
0074   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Mod_R;
0075   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Bla_R;
0076   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Disk_R;
0077   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Pan_Phi;
0078   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Mod_Phi;
0079   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Bla_Phi;
0080   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Pan_Z;
0081   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Mod_Z;
0082   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Bla_Z;
0083   std::map<unsigned int, TH2D*> mapPXF2Disk00_hPXF_Disk_Z;
0084 };
0085 
0086 //////////////////////////////////
0087 //                              //
0088 //     CLASS IMPLEMENTATION     //
0089 //                              //
0090 //////////////////////////////////
0091 
0092 //////////////
0093 // CONSTRUCTOR
0094 AnalyzerPrintGeomInfo::AnalyzerPrintGeomInfo(edm::ParameterSet const& iConfig) : config(iConfig) {
0095   /// Insert here what you need to initialize
0096   TextOutput = iConfig.getParameter<std::string>("TextOutput");
0097   DebugMode = iConfig.getParameter<bool>("DebugMode");
0098 
0099   /// Open the output file
0100   outputFile.open(TextOutput, std::ios::out);
0101 }
0102 
0103 /////////////
0104 // DESTRUCTOR
0105 AnalyzerPrintGeomInfo::~AnalyzerPrintGeomInfo() {
0106   /// Insert here what you need to delete
0107   /// when you close the class instance
0108 }
0109 
0110 //////////
0111 // END JOB
0112 void AnalyzerPrintGeomInfo::endJob()  //edm::Run& run, const edm::EventSetup& iSetup
0113 {
0114   /// Things to be done at the exit of the event Loop
0115   outputFile.close();
0116 
0117   std::cerr << " AnalyzerPrintGeomInfo::endJob" << std::endl;
0118   /// End of things to be done at the exit from the event Loop
0119 }
0120 
0121 ////////////
0122 // BEGIN JOB
0123 void AnalyzerPrintGeomInfo::beginJob() {
0124   std::ostringstream histoName;
0125   std::ostringstream histoTitle;
0126 
0127   /// Things to be done before entering the event Loop
0128   std::cerr << " AnalyzerPrintGeomInfo::beginJob" << std::endl;
0129 
0130   edm::Service<TFileService> fs;
0131 
0132   hPXB_Lay_R = fs->make<TH2D>("hPXB_Lay_R", "PXB Layer vs R (cm)", 250, 0, 125, 18, -0.5, 17.5);
0133   hPXB_Lay_R->Sumw2();
0134 
0135   for (unsigned int layer = 0; layer < 18; layer++) {
0136     histoName.str("");
0137     histoName << "hPXB_Lad_Mod_" << layer;
0138     histoTitle.str("");
0139     histoTitle << "PXB Ladder vs Module, Layer " << layer;
0140     mapPXB2Lay_hPXB_Lad_Mod[layer] =
0141         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 201, -0.5, 200.5, 201, -0.5, 200.5);
0142     mapPXB2Lay_hPXB_Lad_Mod[layer]->Sumw2();
0143 
0144     histoName.str("");
0145     histoName << "hPXB_Lad_Phi_" << layer;
0146     histoTitle.str("");
0147     histoTitle << "PXB Ladder vs #phi, Layer " << layer;
0148     mapPXB2Lay_hPXB_Lad_Phi[layer] =
0149         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 180, -M_PI, M_PI, 201, -0.5, 200.5);
0150     mapPXB2Lay_hPXB_Lad_Phi[layer]->Sumw2();
0151 
0152     histoName.str("");
0153     histoName << "hPXB_Mod_Z_" << layer;
0154     histoTitle.str("");
0155     histoTitle << "PXB Module vs z (cm), Layer " << layer;
0156     mapPXB2Lay_hPXB_Mod_Z[layer] =
0157         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 600, -300, 300, 201, -0.5, 200.5);
0158     mapPXB2Lay_hPXB_Mod_Z[layer]->Sumw2();
0159 
0160     histoName.str("");
0161     histoName << "hPXB_Lad_R_" << layer;
0162     histoTitle.str("");
0163     histoTitle << "PXB Ladder vs R (cm), Layer " << layer;
0164     mapPXB2Lay_hPXB_Lad_R[layer] =
0165         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 250, 0, 125, 201, -0.5, 200.5);
0166     mapPXB2Lay_hPXB_Lad_R[layer]->Sumw2();
0167 
0168     histoName.str("");
0169     histoName << "hPXB_Mod_R_" << layer;
0170     histoTitle.str("");
0171     histoTitle << "PXB Module vs R (cm), Layer " << layer;
0172     mapPXB2Lay_hPXB_Mod_R[layer] =
0173         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 250, 0, 125, 201, -0.5, 200.5);
0174     mapPXB2Lay_hPXB_Mod_R[layer]->Sumw2();
0175 
0176     histoName.str("");
0177     histoName << "hPXB_R_" << layer;
0178     histoTitle.str("");
0179     histoTitle << "PXB R (cm), Layer " << layer;
0180     mapPXB2Lay_hPXB_R[layer] = fs->make<TH1D>(histoName.str().c_str(), histoTitle.str().c_str(), 250, 0, 125);
0181     mapPXB2Lay_hPXB_R[layer]->Sumw2();
0182   }
0183 
0184   hPXF_Disk00_Disk = fs->make<TH2D>("hPXF_Disk00_Disk", "PXF Disk00 vs Disk", 18, -0.5, 17.5, 58, -0.5, 57.5);
0185   hPXF_Disk00_Disk->Sumw2();
0186   hPXF_Disk00_Side = fs->make<TH2D>("hPXF_Disk00_Side", "PXF Disk00 vs Side", 7, -3.5, 3.5, 58, -0.5, 57.5);
0187   hPXF_Disk00_Side->Sumw2();
0188   hPXF_Disk00_Z = fs->make<TH2D>("hPXF_Disk00_Z", "PXF Disk00 vs z (cm)", 600, -300, 300, 58, -0.5, 57.5);
0189   hPXF_Disk00_Z->Sumw2();
0190   hPXF_Disk00_R = fs->make<TH2D>("hPXF_Disk00_R", "PXF Disk00 vs R (cm)", 250, 0, 125, 58, -0.5, 57.5);
0191   hPXF_Disk00_R->Sumw2();
0192 
0193   for (unsigned int disc = 0; disc < 58; disc++) {
0194     histoName.str("");
0195     histoName << "hPXF_Pan_Mod_" << disc;
0196     histoTitle.str("");
0197     histoTitle << "PXF Panel vs Module, Disk00 " << disc;
0198     mapPXF2Disk00_hPXF_Pan_Mod[disc] =
0199         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 201, -0.5, 200.5, 11, -0.5, 10.5);
0200     mapPXF2Disk00_hPXF_Pan_Mod[disc]->Sumw2();
0201 
0202     histoName.str("");
0203     histoName << "hPXF_Bla_Mod_" << disc;
0204     histoTitle.str("");
0205     histoTitle << "PXF Blade vs Module, Disk00 " << disc;
0206     mapPXF2Disk00_hPXF_Bla_Mod[disc] =
0207         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 201, -0.5, 200.5, 85, -0.5, 84.5);
0208     mapPXF2Disk00_hPXF_Bla_Mod[disc]->Sumw2();
0209 
0210     histoName.str("");
0211     histoName << "hPXF_Bla_Pan_" << disc;
0212     histoTitle.str("");
0213     histoTitle << "PXF Blade vs Panel, Disk00 " << disc;
0214     mapPXF2Disk00_hPXF_Bla_Pan[disc] =
0215         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 11, -0.5, 10.5, 85, -0.5, 84.5);
0216     mapPXF2Disk00_hPXF_Bla_Pan[disc]->Sumw2();
0217 
0218     histoName.str("");
0219     histoName << "hPXF_Pan_R_" << disc;
0220     histoTitle.str("");
0221     histoTitle << "PXF Panel vs R (cm), Disk00 " << disc;
0222     mapPXF2Disk00_hPXF_Pan_R[disc] =
0223         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 250, 0, 125, 11, -0.5, 10.5);
0224     mapPXF2Disk00_hPXF_Pan_R[disc]->Sumw2();
0225 
0226     histoName.str("");
0227     histoName << "hPXF_Mod_R_" << disc;
0228     histoTitle.str("");
0229     histoTitle << "PXF Module vs R (cm), Disk00 " << disc;
0230     mapPXF2Disk00_hPXF_Mod_R[disc] =
0231         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 250, 0, 125, 201, -0.5, 200.5);
0232     mapPXF2Disk00_hPXF_Mod_R[disc]->Sumw2();
0233 
0234     histoName.str("");
0235     histoName << "hPXF_Bla_R_" << disc;
0236     histoTitle.str("");
0237     histoTitle << "PXF Blade vs R (cm), Disk00 " << disc;
0238     mapPXF2Disk00_hPXF_Bla_R[disc] =
0239         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 250, 0, 125, 85, -0.5, 84.5);
0240     mapPXF2Disk00_hPXF_Bla_R[disc]->Sumw2();
0241 
0242     histoName.str("");
0243     histoName << "hPXF_Pan_Z_" << disc;
0244     histoTitle.str("");
0245     histoTitle << "PXF Panel vs z (cm), Disk00 " << disc;
0246     mapPXF2Disk00_hPXF_Pan_Z[disc] =
0247         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 600, -300, 300, 11, -0.5, 10.5);
0248     mapPXF2Disk00_hPXF_Pan_Z[disc]->Sumw2();
0249 
0250     histoName.str("");
0251     histoName << "hPXF_Mod_Z_" << disc;
0252     histoTitle.str("");
0253     histoTitle << "PXF Module vs z (cm), Disk00 " << disc;
0254     mapPXF2Disk00_hPXF_Mod_Z[disc] =
0255         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 600, -300, 300, 201, -0.5, 200.5);
0256     mapPXF2Disk00_hPXF_Mod_Z[disc]->Sumw2();
0257 
0258     histoName.str("");
0259     histoName << "hPXF_Bla_Z_" << disc;
0260     histoTitle.str("");
0261     histoTitle << "PXF Blade vs z (cm), Disk00 " << disc;
0262     mapPXF2Disk00_hPXF_Bla_Z[disc] =
0263         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 600, -300, 300, 85, -0.5, 84.5);
0264     mapPXF2Disk00_hPXF_Bla_Z[disc]->Sumw2();
0265 
0266     histoName.str("");
0267     histoName << "hPXF_Pan_Phi_" << disc;
0268     histoTitle.str("");
0269     histoTitle << "PXF Panel vs #phi, Disk00 " << disc;
0270     mapPXF2Disk00_hPXF_Pan_Phi[disc] =
0271         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 180, -M_PI, M_PI, 11, -0.5, 10.5);
0272     mapPXF2Disk00_hPXF_Pan_Phi[disc]->Sumw2();
0273 
0274     histoName.str("");
0275     histoName << "hPXF_Mod_Phi_" << disc;
0276     histoTitle.str("");
0277     histoTitle << "PXF Module vs #phi, Disk00 " << disc;
0278     mapPXF2Disk00_hPXF_Mod_Phi[disc] =
0279         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 180, -M_PI, M_PI, 201, -0.5, 200.5);
0280     mapPXF2Disk00_hPXF_Mod_Phi[disc]->Sumw2();
0281 
0282     histoName.str("");
0283     histoName << "hPXF_Bla_Phi_" << disc;
0284     histoTitle.str("");
0285     histoTitle << "PXF Blade vs #phi, Disk00 " << disc;
0286     mapPXF2Disk00_hPXF_Bla_Phi[disc] =
0287         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 180, -M_PI, M_PI, 85, -0.5, 84.5);
0288     mapPXF2Disk00_hPXF_Bla_Phi[disc]->Sumw2();
0289 
0290     histoName.str("");
0291     histoName << "hPXF_Disk_R_" << disc;
0292     histoTitle.str("");
0293     histoTitle << "PXF Disk vs R (cm), Disk00 " << disc;
0294     mapPXF2Disk00_hPXF_Disk_R[disc] =
0295         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 250, 0, 125, 58, -0.5, 57.5);
0296     mapPXF2Disk00_hPXF_Disk_R[disc]->Sumw2();
0297 
0298     histoName.str("");
0299     histoName << "hPXF_Disk_Z_" << disc;
0300     histoTitle.str("");
0301     histoTitle << "PXF Disk vs z (cm), Disk00 " << disc;
0302     mapPXF2Disk00_hPXF_Disk_Z[disc] =
0303         fs->make<TH2D>(histoName.str().c_str(), histoTitle.str().c_str(), 600, -300, 300, 58, -0.5, 57.5);
0304     mapPXF2Disk00_hPXF_Disk_Z[disc]->Sumw2();
0305   }
0306 
0307   /// End of things to be done before entering the event Loop
0308 }
0309 
0310 //////////
0311 // ANALYZE
0312 void AnalyzerPrintGeomInfo::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0313   /*
0314   /// Geometry handles etc
0315   edm::ESHandle<TrackerGeometry>                               geometryHandle;
0316   const TrackerGeometry*                                       theGeometry;
0317   edm::ESHandle<StackedTrackerGeometry>           stackedGeometryHandle;
0318   const StackedTrackerGeometry*                   theStackedGeometry;
0319   StackedTrackerGeometry::StackContainerIterator  StackedTrackerIterator;
0320 
0321   /// Geometry setup
0322   /// Set pointers to Geometry
0323   iSetup.get<TrackerDigiGeometryRecord>().get(geometryHandle);
0324   theGeometry = &(*geometryHandle);
0325   /// Set pointers to Stacked Modules
0326   iSetup.get<StackedTrackerGeometryRecord>().get(stackedGeometryHandle);
0327   theStackedGeometry = stackedGeometryHandle.product(); /// Note this is different 
0328                                                         /// from the "global" geometry
0329 
0330   /// GeometricDet
0331   /// This is used to get more information on Modules
0332   const GeometricDet* theTrackerGeometricDet = theGeometry->trackerDet();
0333   std::vector< const GeometricDet* > theModules = theTrackerGeometricDet->deepComponents();
0334  
0335   /// Loop over Stacks
0336   /// Count how many Stacks there are
0337   /// divide it by Layer etc...
0338 
0339   /// Maps to store information by layer
0340   /// Compare to StackedTrackerGeometryBuilder--->Checksums and final summary
0341 
0342   /// PXB
0343   std::map< uint32_t, uint32_t >                   rodsPerLayer;
0344   std::map< uint32_t, uint32_t >                   modsPerRodPerLayer;  /// Assumes all Rods are identical within a Layer
0345   std::map< uint32_t, std::map< uint32_t, bool > > inOutPerRodPerLayer; /// TRUE if innerMod = outerMod + 1
0346 
0347   std::map< uint32_t, double > innerModRadPerLayer;
0348   std::map< uint32_t, double > outerModRadPerLayer;
0349   std::map< uint32_t, double > separationPerLayer;
0350   std::map< uint32_t, double > maxLengthPerLayer;
0351   std::map< uint32_t, double > activeSurfacePerLayer;
0352 
0353   std::map< uint32_t, float > innerModXPitchPerLayer;
0354   std::map< uint32_t, float > outerModXPitchPerLayer;
0355   std::map< uint32_t, float > innerModYPitchPerLayer;
0356   std::map< uint32_t, float > outerModYPitchPerLayer;
0357 
0358   std::map< uint32_t, uint32_t > innerModChannelsPerLayer;
0359   std::map< uint32_t, uint32_t > outerModChannelsPerLayer;
0360 
0361   std::map< uint32_t, uint32_t > innerModXROCPerLayer;
0362   std::map< uint32_t, uint32_t > outerModXROCPerLayer;
0363   std::map< uint32_t, uint32_t > innerModYROCPerLayer;
0364   std::map< uint32_t, uint32_t > outerModYROCPerLayer;
0365   std::map< uint32_t, uint32_t > innerModTotROCPerLayer;
0366   std::map< uint32_t, uint32_t > outerModTotROCPerLayer;
0367 
0368   std::map< uint32_t, uint32_t > innerModColumnsPerLayer;
0369   std::map< uint32_t, uint32_t > outerModColumnsPerLayer;
0370   std::map< uint32_t, uint32_t > innerModRowsPerLayer;
0371   std::map< uint32_t, uint32_t > outerModRowsPerLayer;
0372 
0373   /// PXF
0374   std::map< uint32_t, uint32_t >                       ringsPerDisk;
0375   std::map< uint32_t, std::map< uint32_t, uint32_t > > modsPerRingPerDisk;  /// Assumes all Rings are different within a Disk
0376   std::map< uint32_t, std::map< uint32_t, bool > >     inOutPerRingPerDisk; /// TRUE if innerMod = outerMod + 1
0377 
0378   std::map< uint32_t, std::map< uint32_t, double > > innerModZPerRingPerDisk;
0379   std::map< uint32_t, std::map< uint32_t, double > > outerModZPerRingPerDisk;
0380   std::map< uint32_t, std::map< uint32_t, double > > separationPerRingPerDisk;
0381   std::map< uint32_t, std::map< uint32_t, double > > maxLengthPerRingPerDisk;
0382   std::map< uint32_t, std::map< uint32_t, double > > activeSurfacePerRingPerDisk;
0383 
0384   std::map< uint32_t, std::map< uint32_t, float > > innerModXPitchPerRingPerDisk;
0385   std::map< uint32_t, std::map< uint32_t, float > > outerModXPitchPerRingPerDisk;
0386   std::map< uint32_t, std::map< uint32_t, float > > innerModYPitchPerRingPerDisk;
0387   std::map< uint32_t, std::map< uint32_t, float > > outerModYPitchPerRingPerDisk;
0388 
0389   std::map< uint32_t, std::map< uint32_t, uint32_t > > innerModChannelsPerRingPerDisk;
0390   std::map< uint32_t, std::map< uint32_t, uint32_t > > outerModChannelsPerRingPerDisk;
0391 
0392   std::map< uint32_t, std::map< uint32_t, uint32_t > > innerModXROCPerRingPerDisk;
0393   std::map< uint32_t, std::map< uint32_t, uint32_t > > outerModXROCPerRingPerDisk;
0394   std::map< uint32_t, std::map< uint32_t, uint32_t > > innerModYROCPerRingPerDisk;
0395   std::map< uint32_t, std::map< uint32_t, uint32_t > > outerModYROCPerRingPerDisk;
0396   std::map< uint32_t, std::map< uint32_t, uint32_t > > innerModTotROCPerRingPerDisk;
0397   std::map< uint32_t, std::map< uint32_t, uint32_t > > outerModTotROCPerRingPerDisk;
0398 
0399   std::map< uint32_t, std::map< uint32_t, uint32_t > > innerModColumnsPerRingPerDisk;
0400   std::map< uint32_t, std::map< uint32_t, uint32_t > > outerModColumnsPerRingPerDisk;
0401   std::map< uint32_t, std::map< uint32_t, uint32_t > > innerModRowsPerRingPerDisk;
0402   std::map< uint32_t, std::map< uint32_t, uint32_t > > outerModRowsPerRingPerDisk;
0403 
0404 
0405   /// Validation maps for Geometry
0406   /// Loop only on different sets of sub-tracker detectors
0407   /// PXB
0408   std::vector<GeomDet*> pxbcont = theGeometry->detsPXB();  
0409   for ( unsigned int i = 0; i < pxbcont.size(); i++ )
0410   {
0411     DetId id0 = pxbcont[i]->geographicalId();
0412     PXBDetId detId0 = PXBDetId(id0.rawId());
0413 
0414     unsigned int layer0 = detId0.layer();
0415     unsigned int ladder0 = detId0.ladder();
0416     unsigned int module0 = detId0.module();
0417 
0418     /// Get the position of each sensor
0419     double r0 = pxbcont[i]->position().perp();
0420     double z0 = pxbcont[i]->position().z();
0421     double phi0 = pxbcont[i]->position().phi();
0422 
0423     hPXB_Lay_R->Fill( r0, layer0 );
0424     mapPXB2Lay_hPXB_Lad_Mod[ layer0 ]->Fill( module0, ladder0 );
0425     mapPXB2Lay_hPXB_Lad_Phi[ layer0 ]->Fill( phi0, ladder0 );
0426     mapPXB2Lay_hPXB_Mod_Z[ layer0 ]->Fill( z0, module0 );
0427     mapPXB2Lay_hPXB_Lad_R[ layer0 ]->Fill( r0, ladder0 );
0428     mapPXB2Lay_hPXB_Mod_R[ layer0 ]->Fill( r0, module0 );
0429     mapPXB2Lay_hPXB_R[ layer0 ]->Fill( r0 );
0430   }
0431 
0432   /// PXF
0433   std::vector<GeomDet*> pxfcont = theGeometry->detsPXF();
0434   for ( unsigned int i = 0; i < pxfcont.size(); i++ )
0435   {
0436     DetId id0 = pxfcont[i]->geographicalId();
0437     PXFDetId detId0 = PXFDetId(id0.rawId());
0438 
0439     unsigned int side0 = detId0.side();
0440     unsigned int disk0 = detId0.disk();
0441     unsigned int blade0;
0442     if (disk0 < 4) blade0 = detId0.blade();
0443     else blade0 = detId0.ring();
0444     unsigned int panel0 = detId0.panel();
0445     unsigned int module0 = detId0.module();
0446 
0447     unsigned int disk00 = 2*disk0 + side0%2;
0448 
0449     /// Get the position of each sensor
0450     double r0 = pxfcont[i]->position().perp();
0451     double z0 = pxfcont[i]->position().z();
0452     double phi0 = pxfcont[i]->position().phi();
0453 
0454     hPXF_Disk00_Disk->Fill( disk0, disk00 );
0455     hPXF_Disk00_Side->Fill( side0, disk00 );
0456     hPXF_Disk00_Z->Fill( z0, disk00 );
0457     hPXF_Disk00_R->Fill( r0, disk00 );
0458 
0459     mapPXF2Disk00_hPXF_Pan_Mod[ disk00 ]->Fill( module0, panel0 );
0460     mapPXF2Disk00_hPXF_Bla_Mod[ disk00 ]->Fill( module0, blade0 );
0461     mapPXF2Disk00_hPXF_Bla_Pan[ disk00 ]->Fill( panel0, blade0 );
0462     mapPXF2Disk00_hPXF_Pan_R[ disk00 ]->Fill( r0, panel0 );
0463     mapPXF2Disk00_hPXF_Pan_Z[ disk00 ]->Fill( z0, panel0 );
0464     mapPXF2Disk00_hPXF_Pan_Phi[ disk00 ]->Fill( phi0, panel0 );
0465     mapPXF2Disk00_hPXF_Mod_R[ disk00 ]->Fill( r0, module0 );
0466     mapPXF2Disk00_hPXF_Mod_Z[ disk00 ]->Fill( z0, module0 );
0467     mapPXF2Disk00_hPXF_Mod_Phi[ disk00 ]->Fill( phi0, module0 );
0468     mapPXF2Disk00_hPXF_Bla_R[ disk00 ]->Fill( r0, blade0 );
0469     mapPXF2Disk00_hPXF_Bla_Z[ disk00 ]->Fill( z0, blade0 );
0470     mapPXF2Disk00_hPXF_Bla_Phi[ disk00 ]->Fill( phi0, blade0 );
0471     mapPXF2Disk00_hPXF_Disk_R[ disk00 ]->Fill( r0, disk0 );
0472     mapPXF2Disk00_hPXF_Disk_Z[ disk00 ]->Fill( z0, disk0 );
0473   }
0474 
0475   /// Loop over the detector elements
0476   /// Information from each sensor in each PtModule must be retrieved!
0477   for ( StackedTrackerIterator = theStackedGeometry->stacks().begin();
0478         StackedTrackerIterator != theStackedGeometry->stacks().end();
0479         ++StackedTrackerIterator )
0480   {
0481     StackedTrackerDetUnit* stackDetUnit = *StackedTrackerIterator;
0482     StackedTrackerDetId stackDetId = stackDetUnit->Id();
0483     assert(stackDetUnit == theStackedGeometry->idToStack(stackDetId));
0484 
0485     /// GeomDet and GeomDetUnit are needed to access each
0486     /// DetId and topology and geometric features
0487     /// Convert to specific DetId
0488     const GeomDet* det0 = theStackedGeometry->idToDet(stackDetId, 0);
0489     const GeomDet* det1 = theStackedGeometry->idToDet(stackDetId, 1);
0490     const GeomDetUnit* detUnit0 = theStackedGeometry->idToDetUnit(stackDetId, 0);
0491     const GeomDetUnit* detUnit1 = theStackedGeometry->idToDetUnit(stackDetId, 1);
0492     
0493     /// Barrel
0494     if ( stackDetId.isBarrel() )
0495     { 
0496       PXBDetId detId0 = PXBDetId(det0->geographicalId().rawId());
0497       PXBDetId detId1 = PXBDetId(det1->geographicalId().rawId());
0498 
0499       /// Get the Stack, iPhi, iZ from StackedTrackerDetId
0500       uint32_t iStack = stackDetId.iLayer();
0501       uint32_t iPhi   = stackDetId.iPhi();
0502       uint32_t iZ     = stackDetId.iZ();
0503 
0504       /// Get index-coordinates of each sensor from DetId
0505       uint32_t iLayer0  = detId0.layer();
0506       uint32_t iLayer1  = detId1.layer();
0507       uint32_t iRod0    = detId0.ladder();
0508       uint32_t iRod1    = detId1.ladder();
0509       uint32_t iModule0 = detId0.module();
0510       uint32_t iModule1 = detId1.module();
0511 
0512       if ( DebugMode )
0513       {
0514         std::cerr << "Stack: " << iStack << " from Layers:  " << iLayer0 << " " << iLayer1 << std::endl;
0515         std::cerr << "Phi:   " << iPhi <<   " from Rods:    " << iRod0 << " " << iRod1 << std::endl;
0516         std::cerr << "Z:     " << iZ <<     " from Modules: " << iModule0 << " " << iModule1 << " >>> " << (iModule0 == iModule1 + 1) << std::endl;
0517       }
0518 
0519       /// Store the size of rods and layers
0520       if ( rodsPerLayer.find(iStack) == rodsPerLayer.end() )
0521         rodsPerLayer.insert( std::make_pair(iStack, 0) );
0522       if ( iPhi >= rodsPerLayer[iStack] )
0523         rodsPerLayer[iStack] = iPhi;
0524 
0525       if ( modsPerRodPerLayer.find(iStack) == modsPerRodPerLayer.end() )
0526         modsPerRodPerLayer.insert( std::make_pair(iStack, 0) );
0527       if ( iZ >= modsPerRodPerLayer[iStack] )
0528         modsPerRodPerLayer[iStack] = iZ;
0529 
0530       /// This is a debug control that checks if
0531       /// the pairing in Z follows index-based logic
0532       /// of innerZ = outerZ + 1 or not
0533       if ( inOutPerRodPerLayer.find(iStack) == inOutPerRodPerLayer.end() )
0534       {
0535         /// New Layer, new Rod
0536         std::map< uint32_t, bool > tempMap;
0537         tempMap.insert( std::make_pair(iPhi, (iModule1 == (iModule0 + 1))) );
0538         inOutPerRodPerLayer.insert( std::make_pair(iStack, tempMap) );
0539       }
0540       else
0541       {
0542         /// Existing Layer
0543         std::map< uint32_t, bool > tempMap = inOutPerRodPerLayer.find(iStack)->second;
0544         if ( tempMap.find(iPhi) == tempMap.end() )
0545         {
0546           /// New Rod
0547           tempMap.insert( std::make_pair(iPhi, (iModule1 == (iModule0 + 1))) );
0548         }
0549         else
0550         {
0551           /// Existing Rod
0552           tempMap.find(iPhi)->second = tempMap.find(iPhi)->second && (iModule1 == (iModule0 + 1));
0553         }
0554         inOutPerRodPerLayer.find(iStack)->second = tempMap;
0555       }
0556 
0557       /// Get the radius of each sensor and its z
0558       double r0 = det0->position().perp();
0559       double r1 = det1->position().perp();
0560       double z0 = det0->position().z();
0561       double z1 = det1->position().z();
0562 
0563       /// Store radii to find average radius of inner and outer sensor
0564       /// in each Stack layer, and sensor separation in Stacks as well
0565       if ( innerModRadPerLayer.find(iStack) == innerModRadPerLayer.end() )
0566         innerModRadPerLayer.insert( std::make_pair(iStack, 0) );
0567       innerModRadPerLayer[iStack] += r0;
0568       if ( outerModRadPerLayer.find(iStack) == outerModRadPerLayer.end() )
0569         outerModRadPerLayer.insert( std::make_pair(iStack, 0) );
0570       outerModRadPerLayer[iStack] += r1;
0571       if ( separationPerLayer.find(iStack) == separationPerLayer.end() )
0572         separationPerLayer.insert( std::make_pair(iStack, 0) );
0573       separationPerLayer[iStack] += fabs(r1-r0);
0574 
0575       /// Store max length
0576       if ( maxLengthPerLayer.find(iStack) == maxLengthPerLayer.end() )
0577         maxLengthPerLayer.insert( std::make_pair(iStack, 0) );
0578       if ( fabs(z0) > maxLengthPerLayer[iStack] )
0579         maxLengthPerLayer[iStack] = fabs(z0);
0580       if ( fabs(z1) > maxLengthPerLayer[iStack] )
0581         maxLengthPerLayer[iStack] = fabs(z1);
0582 
0583       /// Find pixel pitch and topology related information
0584       const PixelGeomDetUnit* pix0 = dynamic_cast< const PixelGeomDetUnit* >( detUnit0 );
0585       const PixelGeomDetUnit* pix1 = dynamic_cast< const PixelGeomDetUnit* >( detUnit1 );
0586       const PixelTopology* top0 = dynamic_cast<const PixelTopology*>( & (pix0->specificTopology() ));
0587       const PixelTopology* top1 = dynamic_cast<const PixelTopology*>( & (pix1->specificTopology() ));
0588       std::pair< float, float > pitch0 = top0->pitch();
0589       std::pair< float, float > pitch1 = top1->pitch();
0590 
0591       /// Store pixel pitch etc
0592       /// NOTE: this assumes that innermost sensor in a stack layer
0593       /// has ALWAYS the very same pixel pitch
0594       if ( innerModXPitchPerLayer.find(iStack) == innerModXPitchPerLayer.end() )
0595         innerModXPitchPerLayer.insert( std::make_pair(iStack, 0) );
0596       innerModXPitchPerLayer[iStack] += pitch0.first;
0597       if ( outerModXPitchPerLayer.find(iStack) == outerModXPitchPerLayer.end() )
0598         outerModXPitchPerLayer.insert( std::make_pair(iStack, 0) );
0599       outerModXPitchPerLayer[iStack] += pitch1.first;
0600 
0601       if ( innerModYPitchPerLayer.find(iStack) == innerModYPitchPerLayer.end() )
0602         innerModYPitchPerLayer.insert( std::make_pair(iStack, 0) );
0603       innerModYPitchPerLayer[iStack] += pitch0.second;
0604       if ( outerModYPitchPerLayer.find(iStack) == outerModYPitchPerLayer.end() )
0605         outerModYPitchPerLayer.insert( std::make_pair(iStack, 0) );
0606       outerModYPitchPerLayer[iStack] += pitch1.second;
0607 
0608       if ( innerModChannelsPerLayer.find(iStack) == innerModChannelsPerLayer.end() )
0609         innerModChannelsPerLayer.insert( std::make_pair(iStack, 0) );
0610       innerModChannelsPerLayer[iStack] += top0->nrows()*top0->ncolumns();
0611       if ( outerModChannelsPerLayer.find(iStack) == outerModChannelsPerLayer.end() )
0612         outerModChannelsPerLayer.insert( std::make_pair(iStack, 0) );
0613       outerModChannelsPerLayer[iStack] += top1->nrows()*top1->ncolumns();
0614 
0615       if ( innerModRowsPerLayer.find(iStack) == innerModRowsPerLayer.end() )
0616         innerModRowsPerLayer.insert( std::make_pair(iStack, 0) );
0617       innerModRowsPerLayer[iStack] += top0->nrows();
0618       if ( outerModRowsPerLayer.find(iStack) == outerModRowsPerLayer.end() )
0619         outerModRowsPerLayer.insert( std::make_pair(iStack, 0) );
0620       outerModRowsPerLayer[iStack] += top1->nrows();
0621 
0622       if ( innerModColumnsPerLayer.find(iStack) == innerModColumnsPerLayer.end() )
0623         innerModColumnsPerLayer.insert( std::make_pair(iStack, 0) );
0624       innerModColumnsPerLayer[iStack] += top0->ncolumns();
0625       if ( outerModColumnsPerLayer.find(iStack) == outerModColumnsPerLayer.end() )
0626         outerModColumnsPerLayer.insert( std::make_pair(iStack, 0) );
0627       outerModColumnsPerLayer[iStack] += top1->ncolumns();
0628 
0629       /// This loops on GeometricDet to get more detailed information
0630       /// In particular, we are interested in active surface
0631       if ( activeSurfacePerLayer.find(iStack) == activeSurfacePerLayer.end() )
0632         activeSurfacePerLayer.insert( std::make_pair( iStack, 0 ) );
0633       if ( innerModXROCPerLayer.find(iStack) == innerModXROCPerLayer.end() )
0634         innerModXROCPerLayer.insert( std::make_pair(iStack, 0) );
0635       if ( innerModYROCPerLayer.find(iStack) == innerModYROCPerLayer.end() )
0636         innerModYROCPerLayer.insert( std::make_pair(iStack, 0) );
0637       if ( innerModTotROCPerLayer.find(iStack) == innerModTotROCPerLayer.end() )
0638         innerModTotROCPerLayer.insert( std::make_pair(iStack, 0) );    
0639       if ( outerModXROCPerLayer.find(iStack) == outerModXROCPerLayer.end() )
0640         outerModXROCPerLayer.insert( std::make_pair(iStack, 0) );
0641       if ( outerModYROCPerLayer.find(iStack) == outerModYROCPerLayer.end() )
0642         outerModYROCPerLayer.insert( std::make_pair(iStack, 0) );
0643       if ( outerModTotROCPerLayer.find(iStack) == outerModTotROCPerLayer.end() )
0644         outerModTotROCPerLayer.insert( std::make_pair(iStack, 0) );
0645 
0646       bool fastExit0 = false;
0647       bool fastExit1 = false;
0648       for ( unsigned int iMod = 0; iMod < theModules.size() && !(fastExit0 && fastExit1); iMod++ )
0649       {
0650         const GeometricDet* thisModule = theModules.at(iMod);
0651         if ( thisModule->geographicalId() == det0->geographicalId() ||
0652              thisModule->geographicalId() == det1->geographicalId() )
0653         {
0654           double thisSurface = thisModule->bounds()->length()*thisModule->bounds()->width(); /// cm^2
0655           activeSurfacePerLayer[iStack] += thisSurface;
0656 
0657           if ( thisModule->geographicalId() == det0->geographicalId() )
0658           {
0659             innerModXROCPerLayer[iStack] += thisModule->pixROCx();
0660             innerModYROCPerLayer[iStack] += thisModule->pixROCy();
0661             innerModTotROCPerLayer[iStack] += thisModule->pixROCx()*thisModule->pixROCy();
0662             fastExit0 = true;
0663           }
0664           if ( thisModule->geographicalId() == det1->geographicalId() )
0665           {
0666             outerModXROCPerLayer[iStack] += thisModule->pixROCx();
0667             outerModYROCPerLayer[iStack] += thisModule->pixROCy();
0668             outerModTotROCPerLayer[iStack] += thisModule->pixROCx()*thisModule->pixROCy();
0669             fastExit1 = true;
0670           }
0671         }
0672       }
0673     }
0674 
0675     /// Endcap
0676     if ( stackDetId.isEndcap() )
0677     {
0678       PXFDetId detId0 = PXFDetId(det0->geographicalId().rawId());
0679       PXFDetId detId1 = PXFDetId(det1->geographicalId().rawId());
0680 
0681       /// Get the Stack, iPhi, iZ from StackedTrackerDetId
0682       uint32_t iSide  = stackDetId.iSide();
0683       uint32_t iStack = stackDetId.iDisk();
0684       uint32_t iRing  = stackDetId.iRing();
0685       uint32_t iPhi   = stackDetId.iPhi();
0686 
0687       /// Get index-coordinates of each sensor from DetId
0688       uint32_t iDisk0   = detId0.disk();
0689       uint32_t iRing0   = detId0.ring();
0690       uint32_t iModule0 = detId0.module();
0691       uint32_t iDisk1   = detId1.disk();
0692       uint32_t iRing1   = detId1.ring();
0693       uint32_t iModule1 = detId1.module();
0694 
0695       if ( DebugMode )
0696       {
0697         std::cerr << "Side:  " << iSide << std::endl;
0698         std::cerr << "Stack: " << iStack << " from Disks:   " << iDisk0 << " " << iDisk1 << std::endl;
0699         std::cerr << "Ring:  " << iRing <<  " from Rings:   " << iRing0 << " " << iRing1 << std::endl;
0700         std::cerr << "Phi:   " << iPhi <<   " from Modules: " << iModule0 << " " << iModule1 << " >>> " << (iModule0 == iModule1 + 1) << std::endl;
0701       }
0702 
0703       /// Store the size of rods and layers
0704       if ( ringsPerDisk.find(iStack) == ringsPerDisk.end() )
0705         ringsPerDisk.insert( std::make_pair(iStack, 0) );
0706       if ( iRing >= ringsPerDisk[iStack] )
0707         ringsPerDisk[iStack] = iRing;
0708 
0709       if ( modsPerRingPerDisk.find(iStack) == modsPerRingPerDisk.end() )
0710       {
0711         std::map< uint32_t, uint32_t > tempMap;
0712         tempMap.insert( std::make_pair(iRing, 0) );
0713         modsPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0714       }
0715       if ( modsPerRingPerDisk.find(iStack)->second.find(iRing) == modsPerRingPerDisk.find(iStack)->second.end() )
0716         modsPerRingPerDisk.find(iStack)->second.insert( std::make_pair( iRing, 0 ) );
0717       if ( iRing >= ringsPerDisk[iStack] )
0718         ringsPerDisk[iStack] = iRing;
0719       if ( iPhi >= modsPerRingPerDisk.find(iStack)->second.find(iRing)->second )
0720         modsPerRingPerDisk.find(iStack)->second.find(iRing)->second = iPhi;
0721 
0722       /// This is a debug control that checks if
0723       /// the pairing in Phi follows index-based logic
0724       /// of innerPhi = outerPhi + 1 or not
0725       if ( inOutPerRingPerDisk.find(iStack) == inOutPerRingPerDisk.end() )
0726       {
0727         /// New Disk, new Ring
0728         std::map< uint32_t, bool > tempMap;
0729         tempMap.insert( std::make_pair(iRing, (iModule1 == (iModule0 + 1))) );
0730         inOutPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0731       }
0732       else
0733       {
0734         /// Existing Disk
0735         std::map< uint32_t, bool > tempMap = inOutPerRingPerDisk.find(iStack)->second;
0736         if ( tempMap.find(iRing) == tempMap.end() )
0737         {
0738           /// New Ring
0739           tempMap.insert( std::make_pair(iRing, (iModule1 == (iModule0 + 1))) );
0740         }
0741         else {
0742           /// Existing Ring
0743           tempMap.find(iRing)->second = tempMap.find(iRing)->second && (iModule1 == (iModule0 + 1));
0744         }
0745         inOutPerRingPerDisk.find(iStack)->second = tempMap;
0746       }
0747 
0748       /// Get the z of each sensor
0749       double z0 = det0->position().z();
0750       double z1 = det1->position().z();
0751 
0752       /// Store radii to find average radius of inner and outer sensor
0753       /// in each Stack layer, and sensor separation in Stacks as well
0754       if ( innerModZPerRingPerDisk.find(iStack) == innerModZPerRingPerDisk.end() )
0755       {
0756         std::map< uint32_t, double > tempMap;
0757         tempMap.insert( std::make_pair(iRing, 0) );
0758         innerModZPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0759       }
0760       else
0761       {
0762         std::map< uint32_t, double > tempMap = innerModZPerRingPerDisk.find(iStack)->second;
0763         if ( tempMap.find(iRing) == tempMap.end() )
0764         {
0765           tempMap.insert( std::make_pair(iRing, 0) );
0766           innerModZPerRingPerDisk.find(iStack)->second = tempMap;
0767         }
0768       }
0769       innerModZPerRingPerDisk[iStack].find(iRing)->second += fabs(z0);
0770       if ( outerModZPerRingPerDisk.find(iStack) == outerModZPerRingPerDisk.end() )
0771       {
0772         std::map< uint32_t, double > tempMap;
0773         tempMap.insert( std::make_pair(iRing, 0) );
0774         outerModZPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0775       }
0776       else
0777       {
0778         std::map< uint32_t, double > tempMap = outerModZPerRingPerDisk.find(iStack)->second;
0779         if ( tempMap.find(iRing) == tempMap.end() )
0780         {
0781           tempMap.insert( std::make_pair(iRing, 0) );
0782           outerModZPerRingPerDisk.find(iStack)->second = tempMap;
0783         }
0784       }
0785       outerModZPerRingPerDisk[iStack].find(iRing)->second += fabs(z1);
0786       if ( separationPerRingPerDisk.find(iStack) == separationPerRingPerDisk.end() )
0787       {
0788         std::map< uint32_t, double > tempMap;
0789         tempMap.insert( std::make_pair(iRing, 0) );
0790         separationPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0791       }
0792       else
0793       {
0794         std::map< uint32_t, double > tempMap = separationPerRingPerDisk.find(iStack)->second;
0795         if ( tempMap.find(iRing) == tempMap.end() )
0796         {
0797           tempMap.insert( std::make_pair(iRing, 0) );
0798           separationPerRingPerDisk.find(iStack)->second = tempMap;
0799         }
0800       }
0801       separationPerRingPerDisk[iStack].find(iRing)->second += fabs(z1 - z0);
0802 
0803       /// Find pixel pitch and topology related information
0804       const PixelGeomDetUnit* pix0 = dynamic_cast< const PixelGeomDetUnit* >( detUnit0 );
0805       const PixelGeomDetUnit* pix1 = dynamic_cast< const PixelGeomDetUnit* >( detUnit1 );
0806       const PixelTopology* top0 = dynamic_cast<const PixelTopology*>( & (pix0->specificTopology() ));
0807       const PixelTopology* top1 = dynamic_cast<const PixelTopology*>( & (pix1->specificTopology() ));
0808       std::pair< float, float > pitch0 = top0->pitch();
0809       std::pair< float, float > pitch1 = top1->pitch();
0810 
0811       /// Store pixel pitch etc
0812       /// NOTE: this assumes that innermost sensor in a stack layer
0813       /// has ALWAYS the very same pixel pitch
0814       if ( innerModXPitchPerRingPerDisk.find(iStack) == innerModXPitchPerRingPerDisk.end() )
0815       {
0816         std::map< uint32_t, float > tempMap;
0817         tempMap.insert( std::make_pair(iRing, 0) );
0818         innerModXPitchPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0819       }
0820       else
0821       {
0822         std::map< uint32_t, float > tempMap = innerModXPitchPerRingPerDisk.find(iStack)->second;
0823         if ( tempMap.find(iRing) == tempMap.end() )
0824         {
0825           tempMap.insert( std::make_pair(iRing, 0) );
0826           innerModXPitchPerRingPerDisk.find(iStack)->second = tempMap;
0827         }
0828       }
0829       innerModXPitchPerRingPerDisk[iStack].find(iRing)->second += pitch0.first;
0830       if ( outerModXPitchPerRingPerDisk.find(iStack) == outerModXPitchPerRingPerDisk.end() )
0831       {
0832         std::map< uint32_t, float > tempMap;
0833         tempMap.insert( std::make_pair(iRing, 0) );
0834         outerModXPitchPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0835       }
0836       else
0837       {
0838         std::map< uint32_t, float > tempMap = outerModXPitchPerRingPerDisk.find(iStack)->second;
0839         if ( tempMap.find(iRing) == tempMap.end() )
0840         {
0841           tempMap.insert( std::make_pair(iRing, 0) );
0842           outerModXPitchPerRingPerDisk.find(iStack)->second = tempMap;
0843         }
0844       }
0845       outerModXPitchPerRingPerDisk[iStack].find(iRing)->second += pitch1.first;
0846 
0847       if ( innerModYPitchPerRingPerDisk.find(iStack) == innerModYPitchPerRingPerDisk.end() )
0848       {
0849         std::map< uint32_t, float > tempMap;
0850         tempMap.insert( std::make_pair(iRing, 0) );
0851         innerModYPitchPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0852       }
0853       else
0854       {
0855         std::map< uint32_t, float > tempMap = innerModYPitchPerRingPerDisk.find(iStack)->second;
0856         if ( tempMap.find(iRing) == tempMap.end() )
0857         {
0858           tempMap.insert( std::make_pair(iRing, 0) );
0859           innerModYPitchPerRingPerDisk.find(iStack)->second = tempMap;
0860         }
0861       }
0862       innerModYPitchPerRingPerDisk[iStack].find(iRing)->second += pitch0.second;
0863       if ( outerModYPitchPerRingPerDisk.find(iStack) == outerModYPitchPerRingPerDisk.end() )
0864       {
0865         std::map< uint32_t, float > tempMap;
0866         tempMap.insert( std::make_pair(iRing, 0) );
0867         outerModYPitchPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0868       }
0869       else
0870       {
0871         std::map< uint32_t, float > tempMap = outerModYPitchPerRingPerDisk.find(iStack)->second;
0872         if ( tempMap.find(iRing) == tempMap.end() )
0873         {
0874           tempMap.insert( std::make_pair(iRing, 0) );
0875           outerModYPitchPerRingPerDisk.find(iStack)->second = tempMap;
0876         }
0877       }
0878       outerModYPitchPerRingPerDisk[iStack].find(iRing)->second += pitch1.second;
0879 
0880       if ( innerModChannelsPerRingPerDisk.find(iStack) == innerModChannelsPerRingPerDisk.end() )
0881       {
0882         std::map< uint32_t, uint32_t > tempMap;
0883         tempMap.insert( std::make_pair(iRing, 0) );
0884         innerModChannelsPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0885       }
0886       else
0887       {
0888         std::map< uint32_t, uint32_t > tempMap = innerModChannelsPerRingPerDisk.find(iStack)->second;
0889         if ( tempMap.find(iRing) == tempMap.end() )
0890         {
0891           tempMap.insert( std::make_pair(iRing, 0) );
0892           innerModChannelsPerRingPerDisk.find(iStack)->second = tempMap;
0893         }
0894       }
0895       innerModChannelsPerRingPerDisk[iStack].find(iRing)->second += top0->nrows()*top0->ncolumns();
0896       if ( outerModChannelsPerRingPerDisk.find(iStack) == outerModChannelsPerRingPerDisk.end() )
0897       {
0898         std::map< uint32_t, uint32_t > tempMap;
0899         tempMap.insert( std::make_pair(iRing, 0) );
0900         outerModChannelsPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0901       }
0902       else
0903       {
0904         std::map< uint32_t, uint32_t > tempMap = outerModChannelsPerRingPerDisk.find(iStack)->second;
0905         if ( tempMap.find(iRing) == tempMap.end() )
0906         {
0907           tempMap.insert( std::make_pair(iRing, 0) );
0908           outerModChannelsPerRingPerDisk.find(iStack)->second = tempMap;
0909         }
0910       }
0911       outerModChannelsPerRingPerDisk[iStack].find(iRing)->second += top1->nrows()*top1->ncolumns();
0912 
0913       if ( innerModRowsPerRingPerDisk.find(iStack) == innerModRowsPerRingPerDisk.end() )
0914       {
0915         std::map< uint32_t, uint32_t > tempMap;
0916         tempMap.insert( std::make_pair(iRing, 0) );
0917         innerModRowsPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0918       }
0919       else
0920       {
0921         std::map< uint32_t, uint32_t > tempMap = innerModRowsPerRingPerDisk.find(iStack)->second;
0922         if ( tempMap.find(iRing) == tempMap.end() )
0923         {
0924           tempMap.insert( std::make_pair(iRing, 0) );
0925           innerModRowsPerRingPerDisk.find(iStack)->second = tempMap;
0926         }
0927       }
0928       innerModRowsPerRingPerDisk[iStack].find(iRing)->second += top0->nrows();
0929       if ( outerModRowsPerRingPerDisk.find(iStack) == outerModRowsPerRingPerDisk.end() )
0930       {
0931         std::map< uint32_t, uint32_t > tempMap;
0932         tempMap.insert( std::make_pair(iRing, 0) );
0933         outerModRowsPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0934       }
0935       else
0936       {
0937         std::map< uint32_t, uint32_t > tempMap = outerModRowsPerRingPerDisk.find(iStack)->second;
0938         if ( tempMap.find(iRing) == tempMap.end() )
0939         {
0940           tempMap.insert( std::make_pair(iRing, 0) );
0941           outerModRowsPerRingPerDisk.find(iStack)->second = tempMap;
0942         }
0943       }
0944       outerModRowsPerRingPerDisk[iStack].find(iRing)->second += top1->nrows();
0945 
0946       if ( innerModColumnsPerRingPerDisk.find(iStack) == innerModColumnsPerRingPerDisk.end() )
0947       {
0948         std::map< uint32_t, uint32_t > tempMap;
0949         tempMap.insert( std::make_pair(iRing, 0) );
0950         innerModColumnsPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0951       }
0952       else
0953       {
0954         std::map< uint32_t, uint32_t > tempMap = innerModColumnsPerRingPerDisk.find(iStack)->second;
0955         if ( tempMap.find(iRing) == tempMap.end() )
0956         {
0957           tempMap.insert( std::make_pair(iRing, 0) );
0958           innerModColumnsPerRingPerDisk.find(iStack)->second = tempMap;
0959         }
0960       }
0961       innerModColumnsPerRingPerDisk[iStack].find(iRing)->second += top0->ncolumns();
0962       if ( outerModColumnsPerRingPerDisk.find(iStack) == outerModColumnsPerRingPerDisk.end() )
0963       {
0964         std::map< uint32_t, uint32_t > tempMap;
0965         tempMap.insert( std::make_pair(iRing, 0) );
0966         outerModColumnsPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0967       }
0968       else
0969       {
0970         std::map< uint32_t, uint32_t > tempMap = outerModColumnsPerRingPerDisk.find(iStack)->second;
0971         if ( tempMap.find(iRing) == tempMap.end() )
0972         {
0973           tempMap.insert( std::make_pair(iRing, 0) );
0974           outerModColumnsPerRingPerDisk.find(iStack)->second = tempMap;
0975         }
0976       }
0977       outerModColumnsPerRingPerDisk[iStack].find(iRing)->second += top1->ncolumns();
0978 
0979       /// This loops on GeometricDet to get more detailed information
0980       /// In particular, we are interested in active surface
0981       if ( activeSurfacePerRingPerDisk.find(iStack) == activeSurfacePerRingPerDisk.end() )
0982       {
0983         std::map< uint32_t, double > tempMap;
0984         tempMap.insert( std::make_pair(iRing, 0) );
0985         activeSurfacePerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
0986       }
0987       else
0988       {
0989         std::map< uint32_t, double > tempMap = activeSurfacePerRingPerDisk.find(iStack)->second;
0990         if ( tempMap.find(iRing) == tempMap.end() )
0991         {
0992           tempMap.insert( std::make_pair(iRing, 0) );
0993           activeSurfacePerRingPerDisk.find(iStack)->second = tempMap;
0994         }
0995       }
0996 
0997       if ( innerModXROCPerRingPerDisk.find(iStack) == innerModXROCPerRingPerDisk.end() )
0998       {
0999         std::map< uint32_t, uint32_t > tempMap;
1000         tempMap.insert( std::make_pair(iRing, 0) );
1001         innerModXROCPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
1002       }
1003       else
1004       {
1005         std::map< uint32_t, uint32_t > tempMap = innerModXROCPerRingPerDisk.find(iStack)->second;
1006         if ( tempMap.find(iRing) == tempMap.end() )
1007         {
1008           tempMap.insert( std::make_pair(iRing, 0) );
1009           innerModXROCPerRingPerDisk.find(iStack)->second = tempMap;
1010         }
1011       }
1012       if ( outerModXROCPerRingPerDisk.find(iStack) == outerModXROCPerRingPerDisk.end() )
1013       {
1014         std::map< uint32_t, uint32_t > tempMap;
1015         tempMap.insert( std::make_pair(iRing, 0) );
1016         outerModXROCPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
1017       }
1018       else
1019       {
1020         std::map< uint32_t, uint32_t > tempMap = outerModXROCPerRingPerDisk.find(iStack)->second;
1021         if ( tempMap.find(iRing) == tempMap.end() )
1022         {
1023           tempMap.insert( std::make_pair(iRing, 0) );
1024           outerModXROCPerRingPerDisk.find(iStack)->second = tempMap;
1025         }
1026       }
1027 
1028       if ( innerModYROCPerRingPerDisk.find(iStack) == innerModYROCPerRingPerDisk.end() )
1029       {
1030         std::map< uint32_t, uint32_t > tempMap;
1031         tempMap.insert( std::make_pair(iRing, 0) );
1032         innerModYROCPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
1033       }
1034       else
1035       {
1036         std::map< uint32_t, uint32_t > tempMap = innerModYROCPerRingPerDisk.find(iStack)->second;
1037         if ( tempMap.find(iRing) == tempMap.end() )
1038         {
1039           tempMap.insert( std::make_pair(iRing, 0) );
1040           innerModYROCPerRingPerDisk.find(iStack)->second = tempMap;
1041         }
1042       }
1043       if ( outerModYROCPerRingPerDisk.find(iStack) == outerModYROCPerRingPerDisk.end() )
1044       {
1045         std::map< uint32_t, uint32_t > tempMap;
1046         tempMap.insert( std::make_pair(iRing, 0) );
1047         outerModYROCPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
1048       }
1049       else
1050       {
1051         std::map< uint32_t, uint32_t > tempMap = outerModYROCPerRingPerDisk.find(iStack)->second;
1052         if ( tempMap.find(iRing) == tempMap.end() )
1053         {
1054           tempMap.insert( std::make_pair(iRing, 0) );
1055           outerModYROCPerRingPerDisk.find(iStack)->second = tempMap;
1056         }
1057       }
1058 
1059       if ( innerModTotROCPerRingPerDisk.find(iStack) == innerModTotROCPerRingPerDisk.end() )
1060       {
1061         std::map< uint32_t, uint32_t > tempMap;
1062         tempMap.insert( std::make_pair(iRing, 0) );
1063         innerModTotROCPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
1064       }
1065       else
1066       {
1067         std::map< uint32_t, uint32_t > tempMap = innerModTotROCPerRingPerDisk.find(iStack)->second;
1068         if ( tempMap.find(iRing) == tempMap.end() )
1069         {
1070           tempMap.insert( std::make_pair(iRing, 0) );
1071           innerModTotROCPerRingPerDisk.find(iStack)->second = tempMap;
1072         }
1073       }
1074       if ( outerModTotROCPerRingPerDisk.find(iStack) == outerModTotROCPerRingPerDisk.end() )
1075       {
1076         std::map< uint32_t, uint32_t > tempMap;
1077         tempMap.insert( std::make_pair(iRing, 0) );
1078         outerModTotROCPerRingPerDisk.insert( std::make_pair(iStack, tempMap) );
1079       }
1080       else
1081       {
1082         std::map< uint32_t, uint32_t > tempMap = outerModTotROCPerRingPerDisk.find(iStack)->second;
1083         if ( tempMap.find(iRing) == tempMap.end() )
1084         {
1085           tempMap.insert( std::make_pair(iRing, 0) );
1086           outerModTotROCPerRingPerDisk.find(iStack)->second = tempMap;
1087         }
1088       }
1089 
1090       bool fastExit0 = false;
1091       bool fastExit1 = false;
1092       for ( unsigned int iMod = 0; iMod < theModules.size() && !fastExit0 && !fastExit1; iMod++ )
1093       {
1094         const GeometricDet* thisModule = theModules.at(iMod);
1095         if ( thisModule->geographicalId() == det0->geographicalId() ||
1096              thisModule->geographicalId() == det1->geographicalId() )
1097         {
1098           double thisSurface = thisModule->bounds()->length()*thisModule->bounds()->width(); /// cm^2
1099           activeSurfacePerRingPerDisk[iStack].find(iRing)->second += thisSurface;
1100 
1101           if ( thisModule->geographicalId() == det0->geographicalId() )
1102           {
1103             innerModXROCPerRingPerDisk[iStack].find(iRing)->second += thisModule->pixROCx();
1104             innerModYROCPerRingPerDisk[iStack].find(iRing)->second += thisModule->pixROCy();
1105             innerModTotROCPerRingPerDisk[iStack].find(iRing)->second += thisModule->pixROCx()*thisModule->pixROCy();
1106             fastExit0 = true;
1107           }
1108           if ( thisModule->geographicalId() == det1->geographicalId() )
1109           {
1110             outerModXROCPerRingPerDisk[iStack].find(iRing)->second += thisModule->pixROCx();
1111             outerModYROCPerRingPerDisk[iStack].find(iRing)->second += thisModule->pixROCy();
1112             outerModTotROCPerRingPerDisk[iStack].find(iRing)->second += thisModule->pixROCx()*thisModule->pixROCy();
1113             fastExit1 = true;
1114           }
1115         }
1116       }
1117     }
1118   }
1119 
1120   outputFile << " *****************" << std::endl;
1121   outputFile << " * FINAL SUMMARY *" << std::endl;
1122   outputFile << " *****************" << std::endl;
1123 
1124   for ( std::map< uint32_t, uint32_t >::iterator iterMap = rodsPerLayer.begin();
1125         iterMap != rodsPerLayer.end();
1126         ++iterMap )
1127   {
1128     /// Index-coordinates and number of modules 
1129     outputFile << std::endl;
1130     outputFile << " - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" << std::endl; 
1131     outputFile << "  Barrel Stack Layer: " << iterMap->first << std::endl;
1132     outputFile << "   # Rods:            " << iterMap->second << std::endl;
1133     outputFile << "   # Modules/Rod:     " << modsPerRodPerLayer[iterMap->first] << std::endl;
1134     outputFile << "   # Modules          " << modsPerRodPerLayer[iterMap->first] * iterMap->second << std::endl;
1135     if ( DebugMode )
1136     {
1137       outputFile << "     In/Out Correct Order ? ";
1138       for ( std::map< uint32_t, bool >::iterator iterAux = inOutPerRodPerLayer[iterMap->first].begin();
1139             iterAux != inOutPerRodPerLayer[iterMap->first].end();
1140             ++iterAux )
1141       {
1142         outputFile << iterAux->second;
1143       }
1144       outputFile << std::endl;
1145     }
1146 
1147     /// Average radii and separation
1148     outputFile << "  Inner sensor average radius:  " <<
1149       innerModRadPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << " [cm]" << std::endl;
1150     outputFile << "    Outer sensor average radius:  " <<
1151       outerModRadPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << " [cm]" << std::endl;
1152     outputFile << "      Average sensor separation:    " <<
1153       separationPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) * 10 << " [mm]" << std::endl;
1154 
1155     /// Stack length and surface
1156     outputFile << "  Max length of Stack Layer:    " <<
1157       maxLengthPerLayer[iterMap->first] << " [cm]" << std::endl;
1158     outputFile << "  Total active surface:         " <<
1159       activeSurfacePerLayer[iterMap->first] << " [cm^2]" << std::endl;
1160 
1161     /// Topology
1162     outputFile << "  Inner sensor channels:        " <<
1163       innerModChannelsPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << std::endl;
1164     outputFile << "               rows:            " <<
1165       innerModRowsPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << std::endl;
1166     outputFile << "               columns:         " <<
1167       innerModColumnsPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << std::endl;
1168     outputFile << "  Inner sensor average pitch X: " <<
1169       double(int(0.5+(10000*innerModXPitchPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) ))) << " [um]" << std::endl;
1170     outputFile << "                             Y: " <<
1171       double(int(0.5+(10000*innerModYPitchPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) ))) << " [um]" << std::endl;
1172     outputFile << "  Inner sensor ROCs X:          " <<
1173       innerModXROCPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << std::endl;
1174     outputFile << "                    Y:          " <<
1175       innerModYROCPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << std::endl;
1176     outputFile << "                    total:      " <<
1177       innerModTotROCPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << std::endl;
1178     outputFile << "  Outer sensor channels:        " <<
1179       outerModChannelsPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << std::endl;
1180     outputFile << "               rows:            " <<
1181       outerModRowsPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << std::endl;
1182     outputFile << "               columns:         " <<
1183       outerModColumnsPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << std::endl;
1184     outputFile << "  Outer sensor average pitch X: " <<
1185       double(int(0.5+(10000*outerModXPitchPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) ))) << " [um]" << std::endl;
1186     outputFile << "                             Y: " <<
1187       double(int(0.5+(10000*outerModYPitchPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) ))) << " [um]" << std::endl;
1188     outputFile << "  Outer sensor ROCs X:          " <<
1189       outerModXROCPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << std::endl;
1190     outputFile << "                    Y:          " <<
1191       outerModYROCPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << std::endl;
1192     outputFile << "                    total:      " <<
1193       outerModTotROCPerLayer[iterMap->first]/(double)(modsPerRodPerLayer[iterMap->first] * iterMap->second) << std::endl;
1194   }
1195 
1196   for ( std::map< uint32_t, uint32_t >::iterator iterMap = ringsPerDisk.begin();
1197         iterMap != ringsPerDisk.end();
1198         ++iterMap )
1199   {
1200     /// Index-coordinates and number of modules 
1201     outputFile << std::endl;
1202     outputFile << " - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" << std::endl; 
1203     outputFile << "  Endcap Stack Layer: " << iterMap->first << std::endl;
1204     outputFile << "   # Rings:           " << iterMap->second << std::endl;
1205 
1206     uint32_t countMods = 0;
1207 
1208     for ( std::map< uint32_t, uint32_t >::iterator iterOther = modsPerRingPerDisk[iterMap->first].begin();
1209           iterOther != modsPerRingPerDisk[iterMap->first].end();
1210           iterOther++ )
1211     {
1212       outputFile << "   # Modules/Ring:    " << iterOther->second << " in Ring " << iterOther->first << std::endl;
1213       countMods += iterOther->second;
1214     }
1215 
1216     outputFile << "   # Modules          " << countMods << std::endl;
1217     if ( DebugMode )
1218     {
1219       outputFile << "     In/Out Correct Order ? ";
1220       for ( std::map< uint32_t, bool >::iterator iterAux = inOutPerRingPerDisk[iterMap->first].begin();
1221             iterAux != inOutPerRingPerDisk[iterMap->first].end();
1222             ++iterAux )
1223       {
1224         outputFile << iterAux->second;
1225       }
1226       outputFile << std::endl;
1227     }
1228 
1229     /// Average radii and separation
1230     for ( std::map< uint32_t, double >::iterator iterOther = innerModZPerRingPerDisk[iterMap->first].begin();
1231           iterOther != innerModZPerRingPerDisk[iterMap->first].end();
1232           ++iterOther )
1233     {
1234       outputFile << "  Inner sensor average z:  " <<
1235         iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1236         " [cm] in Ring " << iterOther->first << std::endl;
1237     }
1238     for ( std::map< uint32_t, double >::iterator iterOther = outerModZPerRingPerDisk[iterMap->first].begin();
1239           iterOther != outerModZPerRingPerDisk[iterMap->first].end();
1240           ++iterOther )
1241     {
1242       outputFile << "    Outer sensor average z:  " <<
1243         iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1244         " [cm] in Ring " << iterOther->first << std::endl;
1245     }
1246     for ( std::map< uint32_t, double >::iterator iterOther = separationPerRingPerDisk[iterMap->first].begin();
1247           iterOther != separationPerRingPerDisk[iterMap->first].end();
1248           ++iterOther )
1249     {
1250       outputFile << "      Average sensor separation:    " <<
1251         iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second * 10 / 2.0 <<
1252         " [mm] in Ring " << iterOther->first << std::endl;
1253     }
1254 
1255     /// Stack length and surface
1256     for ( std::map< uint32_t, double >::iterator iterOther = activeSurfacePerRingPerDisk[iterMap->first].begin();
1257           iterOther != activeSurfacePerRingPerDisk[iterMap->first].end();
1258           ++iterOther )
1259     {
1260       outputFile << "  Total active surface:         " <<
1261       iterOther->second << // /(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1262         " [cm^2] in Ring " << iterOther->first << std::endl;
1263     }
1264 
1265     /// Topology
1266     for ( std::map< uint32_t, uint32_t >::iterator iterOther = innerModChannelsPerRingPerDisk[iterMap->first].begin();
1267           iterOther != innerModChannelsPerRingPerDisk[iterMap->first].end();
1268           ++iterOther )
1269     {
1270       outputFile << "  Inner sensor channels:        " <<
1271       iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1272         " in Ring " << iterOther->first << std::endl;
1273     }
1274     for ( std::map< uint32_t, uint32_t >::iterator iterOther = innerModRowsPerRingPerDisk[iterMap->first].begin();
1275           iterOther != innerModRowsPerRingPerDisk[iterMap->first].end();
1276           ++iterOther )
1277     {
1278       outputFile << "               rows:            " <<
1279       iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1280         " in Ring " << iterOther->first << std::endl;
1281     }
1282     for ( std::map< uint32_t, uint32_t >::iterator iterOther = innerModColumnsPerRingPerDisk[iterMap->first].begin();
1283           iterOther != innerModColumnsPerRingPerDisk[iterMap->first].end();
1284           ++iterOther )
1285     {
1286       outputFile << "               columns:         " <<
1287       iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1288         " in Ring " << iterOther->first << std::endl;
1289     }
1290     for ( std::map< uint32_t, float >::iterator iterOther = innerModXPitchPerRingPerDisk[iterMap->first].begin();
1291           iterOther != innerModXPitchPerRingPerDisk[iterMap->first].end();
1292           ++iterOther )
1293     {
1294       outputFile << "  Inner sensor average pitch X: " <<
1295       double(int(0.5+(10000*iterOther->second)))/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1296         " [um] in Ring " << iterOther->first << std::endl;
1297     }
1298     for ( std::map< uint32_t, float >::iterator iterOther = innerModYPitchPerRingPerDisk[iterMap->first].begin();
1299           iterOther != innerModYPitchPerRingPerDisk[iterMap->first].end();
1300           ++iterOther )
1301     {
1302       outputFile << "                             Y: " <<
1303       double(int(0.5+(10000*iterOther->second)))/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1304         " [um] in Ring " << iterOther->first << std::endl;
1305     }
1306     for ( std::map< uint32_t, uint32_t >::iterator iterOther = innerModXROCPerRingPerDisk[iterMap->first].begin();
1307           iterOther != innerModXROCPerRingPerDisk[iterMap->first].end();
1308           ++iterOther )
1309     {
1310       outputFile << "  Inner sensor ROCs X:          " <<
1311       iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1312         " in Ring " << iterOther->first << std::endl;
1313     }
1314     for ( std::map< uint32_t, uint32_t >::iterator iterOther = innerModYROCPerRingPerDisk[iterMap->first].begin();
1315           iterOther != innerModYROCPerRingPerDisk[iterMap->first].end();
1316           ++iterOther )
1317     {
1318       outputFile << "                    Y:          " <<
1319       iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1320         " in Ring " << iterOther->first << std::endl;
1321     }
1322     for ( std::map< uint32_t, uint32_t >::iterator iterOther = innerModTotROCPerRingPerDisk[iterMap->first].begin();
1323           iterOther != innerModTotROCPerRingPerDisk[iterMap->first].end();
1324           ++iterOther )
1325     {
1326       outputFile << "                    total:      " <<
1327       iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1328         " in Ring " << iterOther->first << std::endl;
1329     }
1330 
1331     for ( std::map< uint32_t, uint32_t >::iterator iterOther = outerModChannelsPerRingPerDisk[iterMap->first].begin();
1332           iterOther != outerModChannelsPerRingPerDisk[iterMap->first].end();
1333           ++iterOther )
1334     {
1335       outputFile << "  Outer sensor channels:        " <<
1336       iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1337         " in Ring " << iterOther->first << std::endl;
1338     }
1339     for ( std::map< uint32_t, uint32_t >::iterator iterOther = outerModRowsPerRingPerDisk[iterMap->first].begin();
1340           iterOther != outerModRowsPerRingPerDisk[iterMap->first].end();
1341           ++iterOther )
1342     {
1343       outputFile << "               rows:            " <<
1344       iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1345         " in Ring " << iterOther->first << std::endl;
1346     }
1347     for ( std::map< uint32_t, uint32_t >::iterator iterOther = outerModColumnsPerRingPerDisk[iterMap->first].begin();
1348           iterOther != outerModColumnsPerRingPerDisk[iterMap->first].end();
1349           ++iterOther )
1350     {
1351       outputFile << "               columns:         " <<
1352       iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1353         " in Ring " << iterOther->first << std::endl;
1354     }
1355     for ( std::map< uint32_t, float >::iterator iterOther = outerModXPitchPerRingPerDisk[iterMap->first].begin();
1356           iterOther != outerModXPitchPerRingPerDisk[iterMap->first].end();
1357           ++iterOther )
1358     {
1359       outputFile << "  Outer sensor average pitch X: " <<
1360       double(int(0.5+(10000*iterOther->second)))/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1361         " [um] in Ring " << iterOther->first << std::endl;
1362     }
1363     for ( std::map< uint32_t, float >::iterator iterOther = outerModYPitchPerRingPerDisk[iterMap->first].begin();
1364           iterOther != outerModYPitchPerRingPerDisk[iterMap->first].end();
1365           ++iterOther )
1366     {
1367       outputFile << "                             Y: " <<
1368       double(int(0.5+(10000*iterOther->second)))/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1369         " [um] in Ring " << iterOther->first << std::endl;
1370     }
1371     for ( std::map< uint32_t, uint32_t >::iterator iterOther = outerModXROCPerRingPerDisk[iterMap->first].begin();
1372           iterOther != outerModXROCPerRingPerDisk[iterMap->first].end();
1373           ++iterOther )
1374     {
1375       outputFile << "  Outer sensor ROCs X:          " <<
1376       iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1377         " in Ring " << iterOther->first << std::endl;
1378     }
1379     for ( std::map< uint32_t, uint32_t >::iterator iterOther = outerModYROCPerRingPerDisk[iterMap->first].begin();
1380           iterOther != outerModYROCPerRingPerDisk[iterMap->first].end();
1381           ++iterOther )
1382     {
1383       outputFile << "                    Y:          " <<
1384       iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1385         " in Ring " << iterOther->first << std::endl;
1386     }
1387     for ( std::map< uint32_t, uint32_t >::iterator iterOther = outerModTotROCPerRingPerDisk[iterMap->first].begin();
1388           iterOther != outerModTotROCPerRingPerDisk[iterMap->first].end();
1389           ++iterOther )
1390     {
1391       outputFile << "                    total:      " <<
1392       iterOther->second/(double)modsPerRingPerDisk[iterMap->first].find(iterOther->first)->second/2.0 <<
1393         " in Ring " << iterOther->first << std::endl;
1394     }
1395   }
1396   */
1397 }  /// End of analyze()
1398 
1399 ///////////////////////////
1400 // DEFINE THIS AS A PLUG-IN
1401 DEFINE_FWK_MODULE(AnalyzerPrintGeomInfo);