ARA ROOT v3.6 Software

AraEvent/UsefulAtriStationEvent.cxx

00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 #include "UsefulAtriStationEvent.h"
00011 #include "AraEventCalibrator.h"
00012 #include "FFTtools.h"
00013 #include "AraGeomTool.h"
00014 #include "TH1.h"
00015 #include <iostream>
00016 #include <fstream>
00017 #include <cstring>
00018 ClassImp(UsefulAtriStationEvent);
00019 
00020 AraEventCalibrator *fCalibrator;
00021 
00022 UsefulAtriStationEvent::UsefulAtriStationEvent() 
00023 {
00024    //Default Constructor
00025   fNumChannels=0;
00026   fCalibrator=0;
00027 }
00028 
00029 UsefulAtriStationEvent::~UsefulAtriStationEvent() {
00030    //Default Destructor
00031   fNumChannels=0;
00032   fCalibrator=0;
00033 }
00034 
00035 UsefulAtriStationEvent::UsefulAtriStationEvent(RawAtriStationEvent *rawEvent, AraCalType::AraCalType_t calType)
00036  :RawAtriStationEvent(*rawEvent)
00037 {
00038   fCalibrator=AraEventCalibrator::Instance();
00039   fNumChannels=0;
00040   fCalibrator->calibrateEvent(this,calType);
00041   //  fprintf(stderr, "UsefulAtriStationEvent::UsefulAtriStationEvent() -- finished constructing event\n");  //DEBUG
00042 
00043 }
00044 
00045 
00046 TGraph *UsefulAtriStationEvent::getGraphFromElecChan(int chanId)
00047 {
00048   std::map< Int_t, std::vector <Double_t> >::iterator timeMapIt;
00049   timeMapIt=fTimes.find(chanId);
00050   if(timeMapIt==fTimes.end()) {
00051     // This channel doesn't exist. We don't return a null pointer,
00052     // we return an empty graph.
00053     return new TGraph;
00054   }
00055   
00056   TGraph *gr = new TGraph(fTimes[chanId].size(),&(fTimes[chanId][0]),&(fVolts[chanId][0]));
00057   return gr;
00058 }
00059 
00060 TGraph *UsefulAtriStationEvent::getGraphFromRFChan(int chan)
00061 {
00062   return getGraphFromElecChan(chan);
00063   std::cerr << "Error calling UsefulAtriStationEvent::getGraphFromRFChan()\n";
00064   return NULL;
00065 }

Generated on Mon Mar 18 16:04:45 2013 for ARA ROOT v3.6 Software by doxygen 1.4.7