Changeset 765 for trunk/MagicSoft
- Timestamp:
- 04/23/01 15:42:03 (24 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MCT1ReadAscii.cc
r749 r765 28 28 // MCT1ReadAscii // 29 29 // // 30 // Reads a ascii file with CT1 data. The file description and some example // 31 // files can be found on the Magic homepage. // 32 // // 30 33 ///////////////////////////////////////////////////////////////////////////// 31 34 … … 45 48 ClassImp(MCT1ReadAscii) 46 49 50 // -------------------------------------------------------------------------- 51 // 52 // Default constructor. Creates an array which stores the file names of 53 // the files which should be read. If a filename is given it is added 54 // to the list. 55 // 47 56 MCT1ReadAscii::MCT1ReadAscii(const char *fname, 48 57 const char *name, … … 60 69 } 61 70 71 // -------------------------------------------------------------------------- 72 // 73 // Delete the filename list and the input stream if one exists. 74 // 62 75 MCT1ReadAscii::~MCT1ReadAscii() 63 76 { … … 67 80 } 68 81 82 // -------------------------------------------------------------------------- 83 // 84 // Add this file as the last entry in the chain 85 // 69 86 void MCT1ReadAscii::AddFile(const char *txt) 70 87 { 71 // 72 // Add this file as the last entry in the chain 73 // 74 const int sz = fFileNames->GetSize(); 75 const int tsz = strlen(txt)+1; 88 const int sz = fFileNames->GetSize(); 89 const int tsz = strlen(txt)+1; 76 90 77 91 fFileNames->Set(sz+tsz); … … 80 94 } 81 95 96 // -------------------------------------------------------------------------- 97 // 98 // This opens the next file in the list and deletes its name from the list. 99 // 82 100 Bool_t MCT1ReadAscii::OpenNextFile() 83 101 { … … 128 146 } 129 147 148 // -------------------------------------------------------------------------- 149 // 150 // Open the first file in the list. Check for the output containers or create 151 // them if they don't exist. 152 // 153 // Initialize the size of the MPedestalCam container to 127 pixels (CT1 camera) 154 // 130 155 Bool_t MCT1ReadAscii::PreProcess(MParList *pList) 131 156 { … … 159 184 } 160 185 186 // -------------------------------------------------------------------------- 187 // 188 // Read apedestal entry (line) from the file 189 // 161 190 void MCT1ReadAscii::ReadPedestals() 162 191 { … … 185 214 } 186 215 216 // -------------------------------------------------------------------------- 217 // 218 // Read a data entry (line) from the file 219 // 187 220 void MCT1ReadAscii::ReadData() 188 221 { … … 218 251 } 219 252 253 // -------------------------------------------------------------------------- 254 // 255 // Check for the event number and depending on this number decide if 256 // pedestals or event data has to be read. 257 // 258 // If the end of the file is reached try to open the next in the list. If 259 // there is now next file stop the eventloop. 260 // 220 261 Bool_t MCT1ReadAscii::Process() 221 262 { -
trunk/MagicSoft/Mars/manalysis/MHillas.cc
r749 r765 47 47 ClassImp(MHillas) 48 48 49 // -------------------------------------------------------------------------- 50 // 51 // Default constructor. 52 // 49 53 MHillas::MHillas(const char *name, const char *title) : 50 54 fAlpha(0), fTheta(0), fWidth(0), fLength(0), fSize(0), fDist(0), fEllipse(NULL) … … 56 60 } 57 61 62 // -------------------------------------------------------------------------- 63 // 64 // Destructor. Deletes the TEllipse if one exists. 65 // 58 66 MHillas::~MHillas() 59 67 { … … 61 69 } 62 70 71 // -------------------------------------------------------------------------- 72 // 73 // Print the hillas Parameters to *fLog 74 // 63 75 void MHillas::Print(Option_t *) 64 76 { … … 71 83 } 72 84 85 // -------------------------------------------------------------------------- 86 // 87 // call the Paint function of the Ellipse if a TEllipse exists 88 // 73 89 void MHillas::Paint(Option_t *) 74 90 { … … 79 95 } 80 96 97 // -------------------------------------------------------------------------- 98 // 99 // Instead of adding MHillas itself to the Pad 100 // (s. AppendPad in TObject) we create an ellipse, 101 // which is added to the Pad by it's Draw function 102 // You can remove it by deleting the Ellipse Object 103 // (s. Clear() ) 104 // 81 105 void MHillas::Draw(Option_t *) 82 106 { 83 //84 // Instead of adding MHillas itself to the Pad85 // (s. AppendPad in TObject) we create an ellipse,86 // which is added to the Pad by it's Draw function87 // You can remove it by deleting the Ellipse Object88 // (s. Clear() )89 //90 91 107 Clear(); 92 108 … … 112 128 } 113 129 130 // -------------------------------------------------------------------------- 131 // 132 // If a TEllipse object exists it is deleted 133 // 114 134 void MHillas::Clear(Option_t *) 115 135 { … … 122 142 } 123 143 144 // -------------------------------------------------------------------------- 145 // 146 // Calculate the Hillas parameters from a cerenkov photon event 147 // (The calcualtion is some kind of two dimentional statistics) 148 // 124 149 Bool_t MHillas::Calc(MGeomCam &geom, MCerPhotEvt &evt) 125 150 { 126 //127 // Calculate the Hillas parameters from a cerenkov photon event128 // (The calcualtion is some kind of two dimentional statistics)129 //130 131 151 const UInt_t nevt = evt.GetNumPixels(); 132 152 -
trunk/MagicSoft/Mars/manalysis/MHillasCalc.cc
r749 r765 26 26 ///////////////////////////////////////////////////////////////////////////// 27 27 // // 28 // MHillas Calc // 28 // MHillasCalc // 29 // // 30 // This is a task to calculate the Hillas parameters from each event // 29 31 // // 30 32 ///////////////////////////////////////////////////////////////////////////// … … 42 44 ClassImp(MHillasCalc) 43 45 46 // -------------------------------------------------------------------------- 47 // 48 // Default constructor. 49 // 44 50 MHillasCalc::MHillasCalc(const char *name, const char *title) 45 51 { … … 48 54 } 49 55 56 // -------------------------------------------------------------------------- 57 // 58 // Check for a MCerPhotEvt object from which the Hillas are calculated. 59 // Try to find the Geometry conatiner. And try to find the output 60 // (Hillas) container or create one. 61 // 50 62 Bool_t MHillasCalc::PreProcess( MParList *pList ) 51 63 { … … 71 83 } 72 84 85 // -------------------------------------------------------------------------- 86 // 87 // If you want do complex descisions inside the calculations 88 // we must move the calculation code inside this function 89 // 90 // If the calculation wasn't sucessfull skip this event 91 // 73 92 Bool_t MHillasCalc::Process() 74 93 { 75 //76 // If you want do complex descisions inside the calculations77 // we must move the calculation code inside this function78 //79 // If the calculation wasn't sucessfull skip this event80 //81 94 return fHillas->Calc(*fGeomCam, *fCerPhotEvt) ? kTRUE : kCONTINUE; 82 95 } -
trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc
r749 r765 24 24 \* ======================================================================== */ 25 25 26 ///////////////////////////////////////////////////////////////////////////// 27 // 28 // MImgCleanStd 29 // 30 // This is the standard image cleaning. If you want to know how it works 31 // Please look at the three CleanSteps and Process 32 // 33 ///////////////////////////////////////////////////////////////////////////// 26 34 #include "MImgCleanStd.h" 27 35 … … 36 44 ClassImp(MImgCleanStd) 37 45 46 // -------------------------------------------------------------------------- 47 // 48 // Default constructor. Here you can specify the cleaning levels. If you 49 // don't specify them the 'common standard' values 2.5 and 3.0 (sigma 50 // above mean) are used 51 // 38 52 MImgCleanStd::MImgCleanStd(const Float_t lvl1, const Float_t lvl2, 39 53 const char *name, const char *title) 40 54 : fCleanLvl1(lvl1), fCleanLvl2(lvl2) 41 55 { 42 //43 // the default constructor44 //45 56 *fName = name ? name : "MImgCleanStd"; 46 57 *fTitle = title ? title : "Task which does a standard image cleaning"; … … 49 60 } 50 61 62 // -------------------------------------------------------------------------- 63 // 64 // This method looks for all pixels with an entry (photons) 65 // that is three times bigger than the noise of the pixel 66 // (std: 3 sigma, clean level 1) 67 // 51 68 void MImgCleanStd::CleanStep1() 52 69 { 53 //54 // This method looks for all pixels with an entry (photons)55 // that is three times bigger than the noise of the pixel56 // (std: 3 sigma, clean level 1)57 //58 59 70 const Int_t entries = fEvt->GetNumPixels(); 60 71 … … 76 87 } 77 88 89 // -------------------------------------------------------------------------- 90 // 91 // check if the survived pixel have a neighbor, that also 92 // survived 93 // 78 94 void MImgCleanStd::CleanStep2() 79 95 { 80 //81 // check if the survived pixel have a neighbor, that also82 // survived83 //84 85 96 const Int_t entries = fEvt->GetNumPixels(); 86 97 … … 142 153 } 143 154 155 // -------------------------------------------------------------------------- 156 // 157 // Look for the boundary pixels around the core pixels 158 // if a pixel has more than 2.5 (clean level 2) sigma, and 159 // a core neigbor it is declared as used. 160 // 144 161 void MImgCleanStd::CleanStep3() 145 162 { 146 //147 // Look for the boundary pixels around the core pixels148 // if a pixel has more than 2.5 (clean level 2) sigma, and149 // a core neigbor it is declared as used.150 //151 163 const Int_t entries = fEvt->GetNumPixels(); 152 164 … … 202 214 } 203 215 216 // -------------------------------------------------------------------------- 217 // 218 // check if MEvtHeader exists in the Parameter list already. 219 // if not create one and add them to the list 220 // 204 221 Bool_t MImgCleanStd::PreProcess (MParList *pList) 205 222 { 206 //207 // check if MEvtHeader exists in the Parameter list already.208 // if not create one and add them to the list209 //210 223 fCam = (MGeomCam*)pList->FindObject("MGeomCam"); 211 224 if (!fCam) … … 225 238 } 226 239 240 // -------------------------------------------------------------------------- 241 // 242 // Cleans the image. 243 // 227 244 Bool_t MImgCleanStd::Process() 228 245 { -
trunk/MagicSoft/Mars/manalysis/MPedestalCam.cc
r749 r765 36 36 ClassImp(MPedestalCam) 37 37 38 // -------------------------------------------------------------------------- 39 // 40 // Default constructor. Creates a MPedestalPix object for each pixel 41 // 38 42 MPedestalCam::MPedestalCam(const char *name, const char *title) 39 43 { … … 50 54 } 51 55 56 // -------------------------------------------------------------------------- 57 // 58 // Delete the array conatining the pixel pedest information 59 // 52 60 MPedestalCam::~MPedestalCam() 53 61 { 62 // FIXME: Do we have to delete the objects itself? 54 63 delete fArray; 55 64 } -
trunk/MagicSoft/Mars/manalysis/MPedestalPix.cc
r749 r765 33 33 #include "MPedestalPix.h" 34 34 35 //#include <fstream.h>36 37 35 #include "MLog.h" 38 36 -
trunk/MagicSoft/Mars/mbase/MLog.h
r698 r765 116 116 } 117 117 118 ClassDef(MLog, 0) 118 ClassDef(MLog, 0) // This is what we call 'The logging system' 119 119 }; 120 120 -
trunk/MagicSoft/Mars/mhist/MFillHFadc.cc
r749 r765 24 24 \* ======================================================================== */ 25 25 26 //////////////////////////////////////////////////////////////////////// 26 ////////////////////////////////////////////////////////////////////////////// 27 27 // 28 28 // MFillHFadc … … 32 32 // This histograms (one per pixel) are stored in MHFadcCam, MHFadcPix 33 33 // 34 //////////////////////////////////////////////////////////////////////// 34 ////////////////////////////////////////////////////////////////////////////// 35 35 36 36 #include "MFillHFadc.h" … … 45 45 ClassImp(MFillHFadc) 46 46 47 // -------------------------------------------------------------------------- 47 48 MFillHFadc::MFillHFadc (const char *name, const char *title) : fRawEvtData(NULL) 48 49 { … … 51 52 } 52 53 54 // -------------------------------------------------------------------------- 55 // 56 // The PrProcess function checks for the existance of all necessary 57 // parameter containers 58 // 53 59 Bool_t MFillHFadc::PreProcess (MParList *pList) 54 60 { 55 //56 // The PrProcess function checks for the existance of all necessary57 // parameter containers58 //59 60 61 // 61 62 // check if all necessary input containers are existing … … 78 79 } 79 80 81 // -------------------------------------------------------------------------- 82 // 83 // This process function loops over all pixels in an MRawEvtData 84 // event and fills the values into histograms 85 // 80 86 Bool_t MFillHFadc::Process() 81 87 { 82 //83 // This process function loops over all pixels in an MRawEvtData84 // event and fills the values into histograms85 //86 87 88 // loop over the pixels and fill the values in the histograms 88 89 … … 91 92 const Int_t nhisamples = fRawEvtData->GetNumHiGainSamples() ; 92 93 const Int_t nlosamples = fRawEvtData->GetNumLoGainSamples() ; 93 94 // cout << "HighSamples " << iHighSamples ;95 94 96 95 while ( pixel.Next() ) -
trunk/MagicSoft/Mars/mhist/MFillHHillas.cc
r749 r765 41 41 ClassImp(MFillHHillas) 42 42 43 // -------------------------------------------------------------------------- 43 44 MFillHHillas::MFillHHillas (const char *name, const char *title) 44 45 { … … 47 48 } 48 49 50 // -------------------------------------------------------------------------- 49 51 Bool_t MFillHHillas::PreProcess (MParList *pList) 50 52 { … … 63 65 } 64 66 67 // -------------------------------------------------------------------------- 65 68 Bool_t MFillHHillas::Process() 66 69 { -
trunk/MagicSoft/Mars/mhist/MFillHStarMap.cc
r749 r765 42 42 ClassImp(MFillHStarMap) 43 43 44 // -------------------------------------------------------------------------- 44 45 MFillHStarMap::MFillHStarMap (const char *name, const char *title) 45 46 { … … 48 49 } 49 50 51 // -------------------------------------------------------------------------- 50 52 Bool_t MFillHStarMap::PreProcess (MParList *pList) 51 53 { … … 64 66 } 65 67 68 // -------------------------------------------------------------------------- 66 69 Bool_t MFillHStarMap::Process() 67 70 { -
trunk/MagicSoft/Mars/mhist/MHFadcCam.cc
r749 r765 38 38 ClassImp(MHFadcCam) 39 39 40 // -------------------------------------------------------------------------- 41 // 42 // default constructor 43 // creates an a list of histograms for all pixels and both gain channels 44 // 40 45 MHFadcCam::MHFadcCam (const char *name, const char *title) 41 46 { 42 //43 // default constructor44 // creates an a list of histograms for all pixels and both gain channels45 //46 47 47 // 48 48 // set the name and title of this object … … 63 63 } 64 64 65 // -------------------------------------------------------------------------- 65 66 MHFadcCam::~MHFadcCam () 66 67 { -
trunk/MagicSoft/Mars/mhist/MHFadcPix.cc
r749 r765 39 39 ClassImp(MHFadcPix) 40 40 41 // -------------------------------------------------------------------------- 42 // 43 // Creates the histograms for lo and hi gain of one pixel 44 // 41 45 MHFadcPix::MHFadcPix(UInt_t pixid) 42 46 { 43 //44 // Creates the histograms for lo and hi gain of one pixel45 //46 47 // FIXME! Set the right axis titles and ... and ... 47 //48 48 Char_t tmp1[40]="hi"; 49 49 Char_t tmp2[40]="hi gain Pixel"; … … 68 68 } 69 69 70 // -------------------------------------------------------------------------- 70 71 MHFadcPix::~MHFadcPix() 71 72 { … … 74 75 } 75 76 77 // -------------------------------------------------------------------------- 76 78 void MHFadcPix::Draw(Option_t *) 77 79 { -
trunk/MagicSoft/Mars/mmain/MDataCheck.h
r714 r765 39 39 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2); 40 40 41 ClassDef(MDataCheck, 0) 41 ClassDef(MDataCheck, 0) // GUI: The 'data-check' window. 42 42 }; 43 43 -
trunk/MagicSoft/Mars/mmain/MMars.h
r714 r765 66 66 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2); 67 67 68 ClassDef(MMars, 0) 68 ClassDef(MMars, 0) // GUI: Mars - the main window 69 69 } ; 70 70 -
trunk/MagicSoft/Mars/mmain/MMonteCarlo.h
r714 r765 29 29 Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2); 30 30 31 ClassDef(MMonteCarlo, 0) 31 ClassDef(MMonteCarlo, 0) // GUI: The 'monte-carlo' window 32 32 }; 33 33 -
trunk/MagicSoft/Mars/mraw/MRawCrateArray.cc
r760 r765 25 25 ///////////////////////////////////////////////////////////////////////////// 26 26 // 27 // MRawCrateArray27 // MRawCrateArray 28 28 // 29 // This class exists to make it possible to read in the crate data 30 // TClones Array. In principal we can directly write the TClonesArray 31 // to the root file, but when we read in again the root file we cannot 32 // put the TClonesArray into our parameter list, becaus it isn't derived 33 // from TNamed. This class is derived from TNamed and can be put in the list 29 // This class exists to make it possible to read in the crate data 30 // TClones Array. In principal we can directly write the TClonesArray 31 // to the root file, but when we read in again the root file we cannot 32 // put the TClonesArray into our parameter list, becaus it isn't derived 33 // from MParContainer. This class is derived from MParContainer and can be 34 // put in the list. The TClones Array containes conatiners which store 35 // the information about one crate (MRawCrateData). 34 36 // 35 37 ///////////////////////////////////////////////////////////////////////////// -
trunk/MagicSoft/Mars/mraw/MRawCrateArray.h
r454 r765 24 24 25 25 void Clear(Option_t *opt=NULL); 26 void Print(Option_t *opt=NULL);27 26 28 27 MRawCrateData *GetEntry(Int_t i); -
trunk/MagicSoft/Mars/mraw/MRawCrateData.cc
r749 r765 23 23 \* ======================================================================== */ 24 24 25 ///////////////////////////////////////////////////////////////////////////// 26 // 27 // MRawCrateData 28 // 29 // This container stores the information about one crate. A list of this 30 // informations can be find at MRawCrateArray 31 // 32 ///////////////////////////////////////////////////////////////////////////// 25 33 #include "MRawCrateData.h" 26 34 … … 30 38 #include <fstream.h> 31 39 40 #include "MLog.h" 41 32 42 ClassImp(MRawCrateData) 33 43 … … 36 46 } 37 47 48 // -------------------------------------------------------------------------- 49 // 50 // read the information from a binary input stream about the CRATE DATA, 51 // like specified in a TDAS note 52 // 38 53 void MRawCrateData::ReadEvt(istream& fin) 39 54 { 40 //41 // read the information from a binary input stream about the CRATE DATA,42 // like specified in a TDAS note43 //44 55 fin.read((Byte_t*)&fDAQCrateNumber, 2); 45 56 fin.read((Byte_t*)&fFADCEvtNumber, 4); … … 47 58 } 48 59 60 // -------------------------------------------------------------------------- 61 // 62 // print all stored information to gLog 63 // 49 64 void MRawCrateData::Print(Option_t *t) 50 65 { 51 // 52 // print all stored information to screen 53 // 54 cout << "Crate Number " << fDAQCrateNumber << ": "; 55 cout << "FADCEventNr=" << fFADCEvtNumber << " "; 56 cout << "FADCClockTick=" << fFADCClockTick << " (20MHz)" << endl; 66 gLog << "Crate Number " << fDAQCrateNumber << ": "; 67 gLog << "FADCEventNr=" << fFADCEvtNumber << " "; 68 gLog << "FADCClockTick=" << fFADCClockTick << " (20MHz)" << endl; 57 69 } -
trunk/MagicSoft/Mars/mraw/MRawEvtHeader.h
r716 r765 43 43 public: 44 44 45 MRawEvtHeader(const char *name=NULL, const char *title=NULL);46 ~MRawEvtHeader();45 MRawEvtHeader(const char *name=NULL, const char *title=NULL); 46 ~MRawEvtHedare(); 47 47 48 void Init(MRawRunHeader *rh, MTime *t);48 void Init(MRawRunHeader *rh, MTime *t); 49 49 50 void Clear(Option_t * = NULL);51 void Print(Option_t * = NULL);50 void Clear(Option_t * = NULL); 51 void Print(Option_t * = NULL); 52 52 53 void FillHeader(UInt_t, Float_t=0);53 void FillHeader(UInt_t, Float_t=0); 54 54 55 UShort_t GetTrigType() const { return fTrigType; }55 UShort_t GetTrigType() const { return fTrigType; } 56 56 57 int ReadEvt(istream& fin);57 int ReadEvt(istream& fin); 58 58 59 ClassDef(MRawEvtHeader, 1) // Parameter Conatiner for raw EVENT HEADER 60 59 ClassDef(MRawEvtHeader, 1) // Parameter Conatiner for raw EVENT HEADER 61 60 }; 62 61
Note:
See TracChangeset
for help on using the changeset viewer.