//////////////////////////////////////////////////////////////////// /// \file PlotFlatMap.cc /// /// \brief Example how to plot a detector flatmap /// /// \author F Descamps /// /// REVISION HISTORY:\n /// 2015-07-16 : F Descamps - First Revision.\n /// /// \details This example plots a flatmap of the detector filled /// with number of hits seen by each PMT. /// //////////////////////////////////////////////////////////////////// #include #include #include #include #include #include #include #include #include #include #include using namespace std; TGraph2D* PlotHitPMTs( const string& fileName ) { // If this is being done on data that does not require remote database connection // eg.: a simple simulation with default run number (0) // We can disable the remote connections: // // NOTE: Don't do this if you are using real data!!! RAT::DB::Get()->SetAirplaneModeStatus(true); // This plots the detector flatmap with the number of hits per PMT RAT::DU::DSReader dsReader( fileName ); const RAT::DU::PMTInfo& pmtInfo = RAT::DU::Utility::Get()->GetPMTInfo(); TGraph2D* PMTStatus = new TGraph2D; std::vector countHits; countHits.resize(pmtInfo.GetCount()); for( size_t i = 0; iSetPoint(i,PMTPosFlat.X(),PMTPosFlat.Y(),countHits[i]); } PMTStatus->SetMarkerStyle(21); PMTStatus->SetMarkerSize(0.5); PMTStatus->Draw("ZCOLPCOL"); return PMTStatus; }