Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:03

0001 #include <iostream>
0002 #include <fstream>
0003 #include <iomanip>
0004 #include <string>
0005 #include <map>
0006 #include <cmath>
0007 
0008 int main(int argc, char **argv) {
0009 
0010   //std::string file = "TimingInfo.txt";
0011   std::string file;
0012   file.assign(argv[1]);
0013   std::map<std::string,double> timingPerModule, timingPerLabel;
0014   std::map<unsigned,double> timingPerEvent;
0015   std::ifstream myTimingFile(file.c_str(),std::ifstream::in);
0016   std::string dummy1, label, module;
0017   double timing;
0018   unsigned idummy1,evt;
0019   int nbofevts = 0;
0020 
0021   // If the machine is busy, the factor is not 100%.
0022   double factor = 0.995;
0023 
0024   if ( myTimingFile ) {
0025     while ( !myTimingFile.eof() ) { 
0026       myTimingFile >> dummy1 >> evt >> idummy1 >> label >> module >> timing ;
0027       // std::cout << evt << " " << module << " " << timing << std::endl;
0028       timingPerEvent[evt]              += timing * factor * 1000.;  
0029       timingPerModule[module]          += timing * factor * 1000.;
0030       timingPerLabel[module+":"+label] += timing * factor * 1000.;
0031     }
0032     nbofevts = (int) timingPerEvent.size();
0033   } else {
0034     std::cout << "File " << file << " does not exist!" << std::endl;
0035   }
0036 
0037   std::map<std::string,double>::const_iterator modIt = timingPerModule.begin();
0038   std::map<std::string,double>::const_iterator labIt = timingPerLabel.begin();
0039   std::map<std::string,double>::const_iterator modEnd = timingPerModule.end();
0040   std::map<std::string,double>::const_iterator labEnd = timingPerLabel.end();
0041   std::map<double,std::string> modulePerTiming;
0042   std::map<double,std::string> labelPerTiming;
0043 
0044   for ( ; modIt != modEnd; ++modIt ) {
0045     double time = modIt->second/((double)nbofevts-1.);
0046     std::string name = modIt->first;
0047     modulePerTiming[time] = name;
0048   }
0049     
0050   for ( ; labIt != labEnd; ++labIt ) {
0051     double time = labIt->second/((double)nbofevts-1.);
0052     std::string name = labIt->first;
0053     labelPerTiming[time] = name;
0054   }
0055     
0056   std::map<double,std::string>::const_reverse_iterator timeIt = modulePerTiming.rbegin();
0057   std::map<double,std::string>::const_reverse_iterator timeEnd = modulePerTiming.rend();
0058   std::map<double,std::string>::const_reverse_iterator timeIt2 = labelPerTiming.rbegin();
0059   std::map<double,std::string>::const_reverse_iterator timeEnd2 = labelPerTiming.rend();
0060 
0061   std::cout << "Timing per module " << std::endl;
0062   std::cout << "================= " << std::endl;
0063   double totalTime = 0.;
0064   unsigned i=1;
0065   for ( ; timeIt != timeEnd; ++timeIt ) {
0066 
0067     totalTime += timeIt->first;
0068     std::cout << std::setw(3) << i++ 
0069           << std::setw(50) << timeIt->second << " : " 
0070           << std::setw(7) << std::setprecision(3) << timeIt-> first << " ms/event"
0071           << std::endl;
0072   }
0073   std::cout << "Total time = " << totalTime << " ms/event " << std::endl;
0074 
0075 /*
0076   std::cout << "================= " << std::endl;
0077   std::cout << "Timing per label  " << std::endl;
0078   std::cout << "================= " << std::endl;
0079   totalTime = 0.;
0080   i = 1;
0081   for ( ; timeIt2 != timeEnd2; ++timeIt2 ) {
0082 
0083     totalTime += timeIt2->first;
0084     std::cout << std::setw(3) << i++ 
0085           << std::setw(100) << timeIt2->second << " : " 
0086           << std::setw(7) << std::setprecision(3) << timeIt2-> first << " ms/event"
0087           << std::endl;
0088   }
0089 */
0090 
0091   double subtotaltimepermodule = 0;
0092   double cumulativetimepermodule = 0;
0093   
0094   std::cout << "================= " << std::endl;
0095   std::cout << " DQM for collision : Timing per step " << std::endl;
0096   std::cout << "================= " << std::endl;
0097 
0098   std::cout << "1. Reconstruction " << std::endl;
0099 
0100   std::cout << "    1.1 Raw2Digi+LocalReco : " << std::endl;
0101   std::cout << "        1.1.1 : Raw2Digi " << std::endl;
0102   subtotaltimepermodule  = 0;
0103   std::cout << "        - " << std::setw(40) << "SiPixelRawToDigi" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelRawToDigi"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0104   subtotaltimepermodule   += timingPerModule["SiPixelRawToDigi"];
0105   cumulativetimepermodule += timingPerModule["SiPixelRawToDigi"];
0106   std::cout << "        - " << std::setw(40) << "SiStripRawToDigi" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripRawToDigiModule"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0107   subtotaltimepermodule   += timingPerModule["SiStripRawToDigiModule"];
0108   cumulativetimepermodule += timingPerModule["SiStripRawToDigiModule"];
0109   std::cout << "          " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0110   std::cout << "          " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0111   std::cout << "        1.1.2 : LocalReco" << std::endl;
0112   subtotaltimepermodule  = 0;
0113   std::cout << "        - " << std::setw(40) << "SiPixelClusterProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelClusterProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0114   subtotaltimepermodule   += timingPerModule["SiPixelClusterProducer"];
0115   cumulativetimepermodule += timingPerModule["SiPixelClusterProducer"];
0116   std::cout << "        - " << std::setw(40) << "SiPixelRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiPixelRecHitConverter:siPixelRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0117   subtotaltimepermodule   += timingPerLabel["SiPixelRecHitConverter:siPixelRecHits"];
0118   cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:siPixelRecHits"];
0119   std::cout << "        - " << std::setw(40) << "SiStripZeroSuppression" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripZeroSuppression"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0120   subtotaltimepermodule   += timingPerModule["SiStripZeroSuppression"];
0121   cumulativetimepermodule += timingPerModule["SiStripZeroSuppression"];
0122   std::cout << "        - " << std::setw(40) << "SiStripClusterizer"     << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripClusterizer"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0123   subtotaltimepermodule   += timingPerModule["SiStripClusterizer"];
0124   cumulativetimepermodule += timingPerModule["SiStripClusterizer"];
0125   std::cout << "        - " << std::setw(40) << "SiStripRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0126   subtotaltimepermodule   += timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHits"];
0127   cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:siStripMatchedRecHits"];
0128   std::cout << "          " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0129   std::cout << "          " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0130 
0131 
0132   std::cout << "    1.2 BeamSpot+RecoPixelVertexing+CkfTracks :" << std::endl;
0133   std::cout << "        1.2.1 : BeamSpot " << std::endl;
0134   subtotaltimepermodule  = 0;
0135   std::cout << "        - " << std::setw(40) << "BeamSpotProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["BeamSpotProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0136   subtotaltimepermodule   += timingPerModule["BeamSpotProducer"];
0137   cumulativetimepermodule += timingPerModule["BeamSpotProducer"];
0138   std::cout << "          " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0139   std::cout << "          " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0140   std::cout << "        1.2.2 : RecoPixelVertexing " << std::endl;
0141   subtotaltimepermodule  = 0;
0142   std::cout << "        - " << std::setw(40) << "PixelTrackProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["PixelTrackProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0143   subtotaltimepermodule   += timingPerModule["PixelTrackProducer"];
0144   cumulativetimepermodule += timingPerModule["PixelTrackProducer"];
0145   std::cout << "        - " << std::setw(40) << "PixelVertexProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["PixelVertexProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0146   subtotaltimepermodule   += timingPerModule["PixelVertexProducer"];
0147   cumulativetimepermodule += timingPerModule["PixelVertexProducer"];
0148   std::cout << "          " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0149   std::cout << "          " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0150   std::cout << "        1.2.3 : CkfTracks " << std::endl;
0151   subtotaltimepermodule  = 0;
0152   std::cout << "        - " << std::setw(40) << "SeedGeneratorFromRegionHitsEDProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["SeedGeneratorFromRegionHitsEDProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0153   subtotaltimepermodule   += timingPerModule["SeedGeneratorFromRegionHitsEDProducer"];
0154   cumulativetimepermodule += timingPerModule["SeedGeneratorFromRegionHitsEDProducer"];
0155 /*
0156             - newSeedFromTriplets
0157             - newSeedFromPairs
0158             - secTriplets
0159             - thPLSeeds
0160             - fourthPLSeeds
0161             - fifthSeeds
0162 */
0163   std::cout << "        - " << std::setw(40) << "CkfTrackCandidateMaker" << std::setw(30) << "" << std::setw(8) << timingPerModule["CkfTrackCandidateMaker"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0164   subtotaltimepermodule   += timingPerModule["CkfTrackCandidateMaker"];
0165   cumulativetimepermodule += timingPerModule["CkfTrackCandidateMaker"];
0166 /*
0167             - newTrackCandidateMaker
0168             - secTrackCandidates
0169             - thTrackCandidates
0170             - fourthTrackCandidates
0171             - fifthTrackCandidates
0172 */
0173   std::cout << "        - " << std::setw(40) << "TrackProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["TrackProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0174   subtotaltimepermodule   += timingPerModule["TrackProducer"];
0175   cumulativetimepermodule += timingPerModule["TrackProducer"];
0176 /*
0177             - preFilterZeroStepTracks
0178             - preFilterStepOneTracks
0179             - secWithMaterialTracks
0180             - thWithMaterialTracks
0181             - fourthWithMaterialTracks
0182             - fifthWithMaterialTracks
0183 */
0184   std::cout << "        - " << std::setw(40) << "AnalyticalTrackSelector" << std::setw(30) << "" << std::setw(8) << timingPerModule["AnalyticalTrackSelector"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0185   subtotaltimepermodule   += timingPerModule["AnalyticalTrackSelector"];
0186   cumulativetimepermodule += timingPerModule["AnalyticalTrackSelector"];
0187 /*
0188             - zeroStepWithLooseQuality
0189             - zeroStepWithTightQuality
0190             - zeroStepTracksWithQuality
0191             - firstStepWithLooseQuality
0192             - firstStepWithTightQuality
0193             - preMergingFirstStepTracksWithQuality
0194             - secStepVtxLoose
0195             - secStepTrkLoose
0196             - secStepVtxTight
0197             - secStepTrkTight
0198             - secStepVtx
0199             - secStepTrk
0200             - thStepVtxLoose
0201             - thStepTrkLoose
0202             - thStepVtxTight
0203             - thStepTrkTight
0204             - thStepVtx
0205             - thStepTrk
0206             - pixellessStepLoose
0207             - pixellessStepTight
0208             - pixellessStep
0209             - tobtecStepLoose
0210             - tobtecStepTight
0211             - tobtecStep
0212 */
0213   std::cout << "        - " << std::setw(40) << "QualityFilter" << std::setw(30) << "" << std::setw(8) << timingPerModule["QualityFilter"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0214   subtotaltimepermodule   += timingPerModule["QualityFilter"];
0215   cumulativetimepermodule += timingPerModule["QualityFilter"];
0216 /*
0217             - zeroStepFilter
0218             - firstfilter
0219             - secfilter
0220             - thfilter
0221             - fourthfilter
0222 */
0223   std::cout << "        - " << std::setw(40) << "TrackClusterRemover" << std::setw(30) << "" << std::setw(8) << timingPerModule["TrackClusterRemover"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0224   subtotaltimepermodule   += timingPerModule["TrackClusterRemover"];
0225   cumulativetimepermodule += timingPerModule["TrackClusterRemover"];
0226 /*
0227             - newClusters
0228             - secClusters
0229             - thClusters
0230             - fourthClusters
0231             - fifthClusters
0232 */
0233   std::cout << "        - " << std::setw(40) << "SiPixelRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiPixelRecHitConverter:newPixelRecHits"]/((double)nbofevts-1.)
0234                                                               +timingPerLabel["SiPixelRecHitConverter:secPixelRecHits"]/((double)nbofevts-1.)
0235                                                               +timingPerLabel["SiPixelRecHitConverter:thPixelRecHits"]/((double)nbofevts-1.)
0236                                                               +timingPerLabel["SiPixelRecHitConverter:fourthPixelRecHits"]/((double)nbofevts-1.)
0237                                                               +timingPerLabel["SiPixelRecHitConverter:fifthPixelRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0238   subtotaltimepermodule   += timingPerLabel["SiPixelRecHitConverter:newPixelRecHits"];
0239   subtotaltimepermodule   += timingPerLabel["SiPixelRecHitConverter:secPixelRecHits"];
0240   subtotaltimepermodule   += timingPerLabel["SiPixelRecHitConverter:thPixelRecHits"];
0241   subtotaltimepermodule   += timingPerLabel["SiPixelRecHitConverter:fourthPixelRecHits"];
0242   subtotaltimepermodule   += timingPerLabel["SiPixelRecHitConverter:fifthPixelRecHits"];
0243   cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:newPixelRecHits"];
0244   cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:secPixelRecHits"];
0245   cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:thPixelRecHits"];
0246   cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:fourthPixelRecHits"];
0247   cumulativetimepermodule += timingPerLabel["SiPixelRecHitConverter:fifthPixelRecHits"];
0248 /*
0249             - newPixelRecHits
0250             - secPixelRecHits
0251             - thPixelRecHits
0252             - fourthPixelRecHits
0253             - fifthPixelRecHits
0254 */
0255   std::cout << "        - " << std::setw(40) << "SiStripRecHitConverter" << std::setw(30) << "" << std::setw(8) << timingPerLabel["SiStripRecHitConverter:newStripRecHits"]/((double)nbofevts-1.)
0256                                                               +timingPerLabel["SiStripRecHitConverter:secStripRecHits"]/((double)nbofevts-1.)
0257                                                               +timingPerLabel["SiStripRecHitConverter:thStripRecHits"]/((double)nbofevts-1.)
0258                                                               +timingPerLabel["SiStripRecHitConverter:fourthStripRecHits"]/((double)nbofevts-1.)
0259                                                               +timingPerLabel["SiStripRecHitConverter:fifthStripRecHits"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0260   subtotaltimepermodule   += timingPerLabel["SiStripRecHitConverter:newStripRecHits"];
0261   subtotaltimepermodule   += timingPerLabel["SiStripRecHitConverter:secStripRecHits"];
0262   subtotaltimepermodule   += timingPerLabel["SiStripRecHitConverter:thStripRecHits"];
0263   subtotaltimepermodule   += timingPerLabel["SiStripRecHitConverter:fourthStripRecHits"];
0264   subtotaltimepermodule   += timingPerLabel["SiStripRecHitConverter:fifthStripRecHits"];
0265   cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:newStripRecHits"];
0266   cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:secStripRecHits"];
0267   cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:thStripRecHits"];
0268   cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:fourthStripRecHits"];
0269   cumulativetimepermodule += timingPerLabel["SiStripRecHitConverter:fifthStripRecHits"];
0270 /*
0271             - newStripRecHits
0272             - secStripRecHits
0273             - thStripRecHits
0274             - fourthStripRecHits
0275             - fifthStripRecHits
0276 */
0277   std::cout << "        - " << std::setw(40) << "SimpleTrackListMerger" << std::setw(30) << "" << std::setw(8) << timingPerModule["SimpleTrackListMerger"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0278   subtotaltimepermodule   += timingPerModule["SimpleTrackListMerger"];
0279   cumulativetimepermodule += timingPerModule["SimpleTrackListMerger"];
0280 /*
0281             - merge2nd3rdTracks
0282             - merge4th5thTracks
0283             - iterTracks
0284             - generalTracks
0285 */
0286   std::cout << "        - " << std::setw(40) << "SeedCombiner" << std::setw(30) << "" << std::setw(8) << timingPerModule["SeedCombiner"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0287   subtotaltimepermodule   += timingPerModule["SeedCombiner"];
0288   cumulativetimepermodule += timingPerModule["SeedCombiner"];
0289 /*
0290             - newCombinedSeeds
0291 */
0292   std::cout << "        - " << std::setw(40) << "DeDxEstimatorProducer" << std::setw(30) << "" << std::setw(8) << timingPerModule["DeDxEstimatorProducer"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0293   subtotaltimepermodule   += timingPerModule["DeDxEstimatorProducer"];
0294   cumulativetimepermodule += timingPerModule["DeDxEstimatorProducer"];
0295 /*
0296             - dedxMedian
0297             - dedxHarmonic2
0298 */
0299   std::cout << "          " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0300   std::cout << "          " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0301 
0302 
0303   std::cout << "2. Data quality monitoring : " << std::endl;
0304 
0305   std::cout << "    2.1 DQM common modules " << std::endl;
0306   std::cout << "        2.1.1 : Quality tests " << std::endl;
0307   subtotaltimepermodule  = 0;
0308   std::cout << "        - " << std::setw(40) << "QualityTester" << std::setw(30) << "" << std::setw(8) << timingPerModule["QualityTester"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0309   subtotaltimepermodule   += timingPerModule["QualityTester"];
0310   cumulativetimepermodule += timingPerModule["QualityTester"];
0311 /*
0312             - qTester
0313 */
0314   std::cout << "          " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0315   std::cout << "          " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0316   std::cout << "        2.1.2 : DQM playback environment " << std::endl;
0317   subtotaltimepermodule  = 0;
0318   std::cout << "        - " << std::setw(40) << "DQMEventInfo" << std::setw(30) << "" << std::setw(8) << timingPerLabel["DQMEventInfo:dqmEnv"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0319   subtotaltimepermodule   += timingPerLabel["DQMEventInfo:dqmEnv"];
0320   cumulativetimepermodule += timingPerLabel["DQMEventInfo:dqmEnv"];
0321 /*
0322             - dqmEnv
0323 */
0324   std::cout << "          " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0325   std::cout << "          " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0326 //   std::cout << "     2.1.3 : DQM playback for Tracking info " << std::endl;
0327 //   subtotaltimepermodule  = 0;
0328 //   std::cout << "     - " << std::setw(40) << "DQMEventInfo" << std::setw(30) << "" << std::setw(8) << timingPerLabel["DQMEventInfo:dqmEnvTr"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0329 //   subtotaltimepermodule   += timingPerLabel["DQMEventInfo:dqmEnvTr"];
0330 //   cumulativetimepermodule += timingPerLabel["DQMEventInfo:dqmEnvTr"];
0331 // /*
0332 //          - dqmEnvTr
0333 // */
0334 //   std::cout << "       " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0335 //   std::cout << "       " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0336   std::cout << "        2.1.3 : DQM file saver " << std::endl;
0337   subtotaltimepermodule  = 0;
0338   std::cout << "        - " << std::setw(40) << "DQMFileSaver" << std::setw(30) << "" << std::setw(8) << timingPerModule["DQMFileSaver"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0339   subtotaltimepermodule   += timingPerModule["DQMFileSaver"];
0340   cumulativetimepermodule += timingPerModule["DQMFileSaver"];
0341 /*
0342             - dqmSaver
0343 */
0344   std::cout << "          " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0345   std::cout << "          " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0346 
0347   std::cout << "    2.2 DQM monitoring " << std::endl;
0348   std::cout << "        2.2.1 :  Raw data error monitor" << std::endl;
0349   subtotaltimepermodule  = 0;
0350   std::cout << "        - " << std::setw(40) << "SiPixelRawDataErrorSource" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelRawDataErrorSource"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0351   subtotaltimepermodule   += timingPerModule["SiPixelRawDataErrorSource"];
0352   cumulativetimepermodule += timingPerModule["SiPixelRawDataErrorSource"];
0353 /*
0354             - SiPixelRawDataErrorSource
0355 */
0356   std::cout << "          " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0357   std::cout << "          " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0358 
0359 //   std::cout << "     - " << std::setw(40) << "SiStripMonitorCluster" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripMonitorCluster"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0360 //   subtotaltimepermodule   += timingPerModule["SiStripMonitorCluster"];
0361 //   cumulativetimepermodule += timingPerModule["SiStripMonitorCluster"];
0362 // /*
0363 //          - SiStripMonitorClusterReal
0364 // */
0365 //   std::cout << "     - " << std::setw(40) << "SiStripMonitorTrack" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiStripMonitorTrack"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0366 //   subtotaltimepermodule   += timingPerModule["SiStripMonitorTrack"];
0367 //   cumulativetimepermodule += timingPerModule["SiStripMonitorTrack"];
0368 // /*
0369 //          - SiStripMonitorTrack_gentk
0370 // */
0371 //   std::cout << "     - " << std::setw(40) << "MonitorTrackResiduals" << std::setw(30) << "" << std::setw(8) << timingPerModule["MonitorTrackResiduals"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0372 //   subtotaltimepermodule   += timingPerModule["MonitorTrackResiduals"];
0373 //   cumulativetimepermodule += timingPerModule["MonitorTrackResiduals"];
0374 // /*
0375 //          - MonitorTrackResiduals_gentk
0376 // */
0377 //   std::cout << "     - " << std::setw(40) << "TrackingMonitor" << std::setw(30) << "" << std::setw(8) << timingPerModule["TrackingMonitor"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0378 //   subtotaltimepermodule   += timingPerModule["TrackingMonitor"];
0379 //   cumulativetimepermodule += timingPerModule["TrackingMonitor"];
0380 // /*
0381 //          - TrackMon_gentk
0382 // */
0383 //   std::cout << "       " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0384 //   std::cout << "       " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0385   std::cout << "        2.2.2 : Digi/Cluster/RecHit monitor " << std::endl;
0386   subtotaltimepermodule  = 0;
0387   std::cout << "        - " << std::setw(40) << "SiPixelDigiSource" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelDigiSource"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0388   subtotaltimepermodule   += timingPerModule["SiPixelDigiSource"];
0389   cumulativetimepermodule += timingPerModule["SiPixelDigiSource"];
0390 /*
0391             - SiPixelDigiSource
0392 */
0393   std::cout << "        - " << std::setw(40) << "SiPixelRecHitSource" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelRecHitSource"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0394   subtotaltimepermodule   += timingPerModule["SiPixelRecHitSource"];
0395   cumulativetimepermodule += timingPerModule["SiPixelRecHitSource"];
0396 /*
0397             - SiPixelRecHitSource
0398 */
0399   std::cout << "        - " << std::setw(40) << "SiPixelClusterSource" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelClusterSource"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0400   subtotaltimepermodule   += timingPerModule["SiPixelClusterSource"];
0401   cumulativetimepermodule += timingPerModule["SiPixelClusterSource"];
0402 /*
0403             - SiPixelClusterSource
0404 */
0405   std::cout << "          " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0406   std::cout << "          " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0407 
0408   std::cout << "        2.2.3 : Track monitor " << std::endl;
0409   subtotaltimepermodule  = 0;
0410   std::cout << "        - " << std::setw(40) << "SiPixelTrackResidualSource" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelTrackResidualSource"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0411   subtotaltimepermodule   += timingPerModule["SiPixelTrackResidualSource"];
0412   cumulativetimepermodule += timingPerModule["SiPixelTrackResidualSource"];
0413 /*
0414             - SiPixelTrackResidualSource
0415 */
0416   std::cout << "          " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0417   std::cout << "          " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0418 
0419   std::cout << "        2.2.4 : Pixel EDA client " << std::endl;
0420   subtotaltimepermodule  = 0;
0421   std::cout << "        - " << std::setw(40) << "SiPixelEDAClient" << std::setw(30) << "" << std::setw(8) << timingPerModule["SiPixelEDAClient"]/((double)nbofevts-1.) << " ms/event" << std::endl;
0422   subtotaltimepermodule   += timingPerModule["SiPixelEDAClient"];
0423   cumulativetimepermodule += timingPerModule["SiPixelEDAClient"];
0424 /*
0425             - sipixelEDAClientP5
0426 */
0427   std::cout << "          " << std::setw(70) << "" << std::setw(8) << "--------" << std::endl;
0428   std::cout << "          " << std::setw(70) << "subtotal : " << std::setw(8) << subtotaltimepermodule/((double)nbofevts-1.) << " ms/event" << " / " << std::setw(8) << cumulativetimepermodule/((double)nbofevts-1.) << " ms/event" << std::endl;
0429 
0430   std::cout << "Total nb of events read = " << nbofevts << std::endl;
0431   std::cout << "Total time = " << totalTime << " ms/event " << std::endl;
0432 
0433   std::map<unsigned,double>::const_iterator eventIt = timingPerEvent.begin();
0434   std::map<unsigned,double>::const_iterator eventEnd = timingPerEvent.end();
0435   double minEv = 99999999.;
0436   double maxEv = 0.;
0437   double rms = 0.;
0438   double mean = 0.;
0439   double timeEv = 0;
0440   for ( ; eventIt != eventEnd; ++eventIt ) { 
0441     if ( eventIt->first == 1 ) continue;
0442     timeEv = eventIt->second;
0443     //std::cout << "Evt nr : " << eventIt->first << " / " << timeEv << " ms" << std::endl;
0444     if ( timeEv > maxEv ) maxEv = timeEv;
0445     if ( timeEv < minEv ) minEv = timeEv;
0446     mean += timeEv;
0447     rms  += timeEv*timeEv;    
0448   }
0449 
0450   mean /= ((double)nbofevts-1.);
0451   rms  /= ((double)nbofevts-1.);
0452   rms = std::sqrt(rms-mean*mean);
0453   std::cout << "Total time = " << mean << " +/- " << rms << " ms/event" << std::endl;
0454   std::cout << "Min.  time = " << minEv << " ms/event" << std::endl;
0455   std::cout << "Max.  time = " << maxEv << " ms/event" << std::endl;
0456 }
0457