Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:34

0001 #include "L1Trigger/CSCTrackFinder/test/src/StatisticsFile.h"
0002 
0003 
0004 
0005 
0006 namespace csctf_analysis
0007 {
0008   StatisticsFile::StatisticsFile( )
0009   {
0010     // default constructor
0011   }
0012   StatisticsFile::StatisticsFile( const std::string fname )
0013   {
0014     Create( fname );
0015 
0016 
0017   }
0018 
0019   void StatisticsFile::Create( const std::string fname )
0020   {
0021     statFileOut.open( fname.c_str() );
0022     std::cout << "opening StatisticsFile\n";
0023 
0024   }
0025 
0026 
0027   StatisticsFile::~StatisticsFile()
0028   {
0029     //ensure close of file
0030     Close();
0031   }
0032 
0033 
0034   void StatisticsFile::WriteStatistics( TrackHistogramList tfHistList, TrackHistogramList refHistList)
0035   {
0036     if ( statFileOut.is_open() )
0037       {
0038 
0039     statFileOut << "CSCTFEfficiency Statistics File \n";
0040 
0041     statFileOut << "\n\nTotal Sim Tracks " << refHistList.Phi->GetEntries();
0042     statFileOut << "\nQuality >= 1 Efficiency " << tfHistList.PhiQ1->GetEntries() / refHistList.Phi->GetEntries();
0043     statFileOut << "\nQuality >= 2 Efficiency " << tfHistList.PhiQ2->GetEntries() / refHistList.Phi->GetEntries();
0044     statFileOut << "\nQuality >= 3 Efficiency " << tfHistList.PhiQ3->GetEntries() / refHistList.Phi->GetEntries();
0045 
0046     statFileOut << "\n\nGhosts and Lost Track Statistics\n";
0047     statFileOut << "Quality > 0 Ghosts " << tfHistList.ghostPhi->GetEntries();
0048     statFileOut << "\nGhosts / Sim Tracks " << tfHistList.ghostPhi->GetEntries() / refHistList.Phi->GetEntries();
0049     statFileOut << "\n";
0050 
0051 
0052       }
0053     
0054   }
0055 
0056 }