Changeset 597
- Timestamp:
- 02/07/01 16:50:22 (24 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/readCT1.C
r596 r597 11 11 MNphotEvent *phevt = new MNphotEvent() ; 12 12 13 14 13 plist->AddToList( phevt ) ; 15 14 16 17 15 //MReadCT1Ascii *readct1 = new MReadCT1Ascii("/hd10/www/Anal_MAGIC/MCCT1_99_ga20.dat") ; 18 16 … … 22 20 23 21 Int_t icount = 0 ; 24 25 22 MCamDisplay display(0) ; 26 23 … … 31 28 cout << "Event: " << icount++ << endl ; 32 29 33 if ( icount == 3 ) { 34 phevt->Print() ; 35 } 36 30 31 phevt->Print() ; 32 37 33 display->Draw( phevt ) ; 38 // display->DrawError( phevt ) ;39 40 34 gClient->HandleInput(); 41 42 35 if(getchar()=='q') 43 36 break; 37 38 phevt->CleanLevel1() ; 39 40 phevt->CleanLevel2() ; 41 42 display->Draw( phevt ) ; 43 gClient->HandleInput(); 44 if(getchar()=='q') 45 break; 46 47 44 48 } 45 49 -
trunk/MagicSoft/Mars/manalysis/AnalysisIncl.h
r592 r597 5 5 6 6 #include "MParContainer.h" 7 #include "MCamNeighbor.h" 7 8 8 9 #endif // __CINT__ -
trunk/MagicSoft/Mars/manalysis/MNphotEvent.cc
r596 r597 6 6 7 7 #include "MCamGeom.h" 8 #include "MCamNeighbor.h" 8 9 #include "MCamDisplay.h" 9 10 #include "MHexagon.h" … … 16 17 // default constructor 17 18 fPixId = pix ; 19 fIsUsed = kTRUE ; 18 20 fPhot = phot ; 19 21 fErrPhot = errphot ; … … 23 25 { 24 26 fPixId = pix ; 27 fIsUsed = kTRUE ; 25 28 fPhot = phot ; 26 29 fErrPhot = errphot ; … … 30 33 { 31 34 // information about a pixel 32 cout << "MNphotPix: Pixel: "<< fPixId 33 << " Nphot= " << fPhot 35 cout << "MNphotPix: Pixel: "<< fPixId ; 36 37 if ( fIsUsed == kTRUE ) 38 cout << " Used " ; 39 else 40 if ( fIsUsed == kFALSE ) 41 cout << " UnUsed " ; 42 43 cout << " Nphot= " << fPhot 34 44 << " Error(Nphot) = " << fErrPhot 35 45 << endl ; … … 54 64 fPixels = new TClonesArray ("MNphotPix", 577) ; 55 65 66 fNN = new MCamNeighbor() ; 67 56 68 fPixels->Clear() ; 57 69 } … … 59 71 void MNphotEvent::Draw(Option_t* option) 60 72 { 61 // 73 // FIXME!!! 62 74 // 63 75 … … 102 114 } 103 115 } 104 116 117 void MNphotEvent::CleanLevel1() 118 { 119 // This method looks for all pixels with an entry (photons) 120 // that is three times bigger than the noise of the pixel 121 122 Float_t entry, noise ; 123 124 // first look for pixels above some noise level 125 126 for (Int_t il=0; il<fPixels->GetEntries(); il++ ) 127 { 128 entry = ((MNphotPix *) fPixels->At(il))->GetPhotons() ; 129 noise = 3 * ((MNphotPix *) fPixels->At(il))->GetErrorPhot() ; 130 131 if (entry < 3 * noise ) 132 ((MNphotPix *) fPixels->At(il))->SetPixelUnused() ; 133 134 } 135 } 136 137 void MNphotEvent::CleanLevel2() 138 { 139 // check if the survived pixel have a neighbor, that also 140 // survived 141 142 Int_t id, id2 ; 143 Int_t itest ; 144 145 for (Int_t il=0; il<fPixels->GetEntries(); il++ ) 146 { 147 if ( ((MNphotPix *) fPixels->At(il))->IsPixelUsed() == kTRUE ) 148 { 149 id = ((MNphotPix *) fPixels->At(il))->GetPixId() ; 150 151 itest = 0 ; 152 for (Int_t in=0 ; in < 6 ; in++ ) { 153 154 id2 = fNN->GetNN(id, in ) ; 155 156 if ( PixelIsUsed(id2) == kTRUE ) 157 cout << " hulibu " << id << "/" << id2 << endl ; 158 159 160 } 161 } 162 } 163 } 164 165 Bool_t MNphotEvent::PixelExist(Int_t id ) 166 { 167 // Checks if in the pixel list is an entry with pixel id 168 169 for (Int_t il=0; il<fPixels->GetEntries(); il++ ) 170 { 171 if ( id == ((MNphotPix *) fPixels->At(il))->GetPixId() ) { 172 173 cout << " PixelExist " << il ; 174 return kTRUE ; 175 } 176 } 177 178 return kFALSE ; 179 180 } 181 182 Bool_t MNphotEvent::PixelIsUsed(Int_t id ) 183 { 184 // Checks if in the pixel list is an entry with pixel id 185 186 for (Int_t il=0; il<fPixels->GetEntries(); il++ ) 187 { 188 if ( id == ((MNphotPix *) fPixels->At(il))->GetPixId() && 189 ((MNphotPix *) fPixels->At(il))->IsPixelUsed() == kTRUE ) { 190 191 cout << " PixelIsUsed " << il ; 192 return kTRUE ; 193 } 194 } 195 196 return kFALSE ; 197 198 } 199 105 200 Int_t MNphotEvent::GetPixelId(Int_t i ) 106 201 { … … 108 203 } 109 204 205 Bool_t MNphotEvent::IsPixelUsed(Int_t i ) 206 { 207 return ( ( (MNphotPix *) fPixels->At(i))->IsPixelUsed() ) ; 208 } 209 110 210 Float_t MNphotEvent::GetPhotons(Int_t i ) 111 211 { -
trunk/MagicSoft/Mars/manalysis/MNphotEvent.h
r596 r597 10 10 class TClonesArray ; 11 11 class TObjArray ; 12 class MCamNeighbor ; 12 13 13 14 class MNphotPix : public TObject … … 16 17 17 18 Int_t fPixId ; // the pixel Id 19 Bool_t fIsUsed ; // the pixel is used for calculations --> kTRUE 18 20 Float_t fPhot ; // The number of Cerenkov photons 19 21 Float_t fErrPhot ; // the error of fPhot 20 22 21 23 public: 22 24 … … 42 44 void SetPixelContent(Int_t pix , Float_t phot , Float_t errphot ) ; 43 45 46 Bool_t IsPixelUsed() 47 { 48 return fIsUsed ; 49 } 50 51 void SetPixelUnused() 52 { 53 fIsUsed = kFALSE ; 54 } 55 56 void SetPixelUsed() 57 { 58 fIsUsed = kTRUE ; 59 } 60 61 62 44 63 ClassDef(MNphotPix, 1) // Cerenkov Photons class for the pixel 45 64 } ; … … 57 76 Int_t fNbPixels ; // 58 77 TClonesArray *fPixels ; // 78 79 80 MCamNeighbor *fNN ; //! the class with the information about neighbors 59 81 60 82 public: … … 72 94 void Print() ; 73 95 96 void CleanLevel1() ; 97 void CleanLevel2() ; 98 99 Bool_t PixelExist( Int_t id ) ; 100 Bool_t PixelIsUsed( Int_t id ) ; 101 74 102 Int_t GetPixelId(Int_t i ) ; 103 Bool_t IsPixelUsed(Int_t i ) ; 75 104 Float_t GetPhotons(Int_t i ) ; 76 105 Float_t GetErrorPhot(Int_t i ) ; … … 80 109 81 110 ClassDef(MNphotEvent, 1) // class for Nphotons Events 82 }; 111 }; 83 112 84 113 #endif -
trunk/MagicSoft/Mars/manalysis/MReadCT1Ascii.cc
r596 r597 27 27 28 28 fFileName = fname; 29 30 // set the pedestals to default values 31 32 for (Int_t i = 0; i<127; i++ ) 33 { 34 35 fPedest[i] = 1.5 ; 36 } 37 29 38 } 30 39 … … 67 76 return kFALSE ; 68 77 78 // if the first number is negativ this is the pedestal line 79 80 if (dummyI < 0 ) 81 ReadPedestal() ; 82 69 83 fscanf ( fInputfile, "%d", &dummyI ) ; 70 84 fscanf ( fInputfile, "%d", &dummyI ) ; … … 78 92 fscanf ( fInputfile, "%f", &dummyF ) ; 79 93 80 81 94 if ( dummyF > 0.0 ) { 82 fNphot->AddPixel(i, dummyF, sqrt(dummyF)) ;95 fNphot->AddPixel(i, dummyF, fPedest[i] ) ; 83 96 } 84 97 … … 94 107 } 95 108 109 110 void MReadCT1Ascii::ReadPedestal() 111 { 112 cout << " Read in the Pedestals " << endl ; 113 Int_t dummyI ; 114 Float_t dummyF ; 115 116 // the next for values are for dummy 117 fscanf ( fInputfile, "%d", &dummyI ) ; 118 fscanf ( fInputfile, "%d", &dummyI ) ; 119 fscanf ( fInputfile, "%d", &dummyI ) ; 120 fscanf ( fInputfile, "%d", &dummyI ) ; 121 122 // read in the next 127 numbers as the pedestals 123 124 for (Int_t i = 0; i<127; i++ ) 125 { 126 fscanf ( fInputfile, "%f", &dummyF ) ; 127 128 if ( dummyF > 0.0 ) { 129 fPedest[i] = dummyF ; 130 } 131 132 } 133 134 fscanf ( fInputfile, "%d", &dummyI ) ; 135 136 137 } 138 -
trunk/MagicSoft/Mars/manalysis/MReadCT1Ascii.h
r592 r597 17 17 MNphotEvent *fNphot ; //! the data container for all data. 18 18 19 Float_t fPedest[127] ; //! 20 19 21 public: 20 22 MReadCT1Ascii(const char *filename, … … 26 28 Bool_t PostProcess(); 27 29 30 void ReadPedestal() ; 31 28 32 ClassDef(MReadCT1Ascii, 1) // Reads the CT1 data file 29 33 }; 30 34 31 35 #endif 36 -
trunk/MagicSoft/Mars/mgui/GuiLinkDef.h
r589 r597 15 15 #pragma link C++ class MPixGeom; 16 16 #pragma link C++ class MCamGeom; 17 #pragma link C++ class MCamNeighbor; 17 18 18 19 #pragma link C++ class MCamDisplay; -
trunk/MagicSoft/Mars/mgui/MCamDisplay.cc
r596 r597 144 144 UpdateLegend() ; 145 145 } 146 147 148 149 cout << fMinPhe << "/" << fMaxPhe << endl ; 146 147 // update the picture 150 148 151 149 for (Int_t i=0 ; i<event->GetNbPixels() ; i++ ) 152 150 { 153 ( (MHexagon*) fPixels->At( event->GetPixelId(i) ))->SetFillColor( GetColor(event->GetPhotons(i))) ; 154 } 155 151 if ( event->IsPixelUsed(i) == TRUE ) 152 ( (MHexagon*) fPixels->At( event->GetPixelId(i) ))->SetFillColor( GetColor(event->GetPhotons(i))) ; 153 154 } 155 156 156 Draw() ; 157 157 -
trunk/MagicSoft/Mars/mgui/MCamGeom.h
r589 r597 82 82 void Print() ; 83 83 84 85 86 84 ClassDef(MCamGeom, 1) // Base (abstract) class for a task 87 85 }; -
trunk/MagicSoft/Mars/mgui/Makefile
r595 r597 59 59 MHexagon.cc \ 60 60 MCamGeom.cc \ 61 MCamNeighbor.cc \ 61 62 MCamDisplay.cc 62 63
Note:
See TracChangeset
for help on using the changeset viewer.