//////////////////////////////////////////////////////////////////////////// // Input Containers: // MGeomCam // MCerPhotEvt // MPedestalCam // // Output Containers: // MIslands // ///////////////////////////////////////////////////////////////////////////// #include "MIslandCalc.h" #include // atof #include // ofstream, SavePrimitive #include "MLog.h" #include "MLogManip.h" #include "MIslands.h" #include "MParList.h" //#include "MImgCleanStd.h" #include "MLog.h" #include "MLogManip.h" #include "MGeomPix.h" #include "MGeomCam.h" #include "MCerPhotPix.h" #include "MCerPhotEvt.h" #include "MPedestalCam.h" #include "MPedestalPix.h" ClassImp(MIslandCalc); using namespace std; // -------------------------------------------------------------------------- // // Default constructor. // MIslandCalc::MIslandCalc(const char *name, const char *title) : fIsl(NULL) { fName = name ? name : "MIslandCalc"; fTitle = title ? title : "Calculate island parameters"; } Int_t MIslandCalc::PreProcess (MParList *pList) { fCam = (MGeomCam*)pList->FindObject(AddSerialNumber("MGeomCam")); if (!fCam) { *fLog << dbginf << "MGeomCam not found (no geometry information available)... aborting." << endl; return kFALSE; } fEvt = (MCerPhotEvt*)pList->FindObject(AddSerialNumber("MCerPhotEvt")); if (!fEvt) { *fLog << dbginf << "MCerPhotEvt not found... aborting." << endl; return kFALSE; } fPed = (MPedestalCam*)pList->FindObject(AddSerialNumber("MPedestalCam")); if (!fPed) { *fLog << dbginf << "MPedestalCam not found... aborting." << endl; return kFALSE; } fIsl = (MIslands*)pList->FindCreateObj(AddSerialNumber("MIslands")); if (!fIsl) return kFALSE; return kTRUE; } //tries to clean a bit more the image avoiding noisy islands Int_t MIslandCalc::Process() { Float_t noise; Float_t signal; Int_t npix = 577; Int_t sflag; Int_t control; Int_t nvect = 0; Int_t fIslNum = 0; Float_t fSigToNoise[30]; Int_t vect[100][577]; Int_t kk[577]; for(Int_t m = 0; m < 50 ; m++) for(Int_t n = 0; n < 577 ; n++) vect[m][n] = 0; for(Int_t n = 0; n < 577 ; n++) kk[n] = 0; // loop over all pixels for(Int_t idx=0 ; idxGetPixRatio(idx)); noise += pow(ped.GetPedestalRms(),2); } } cout << "Signal: " << signal<SetIslNum(fIslNum); fIsl->SetPixNum(i,fPixNum[i]); fIsl->SetSigToNoise(i,fSigToNoise[i]); cout << " Island Num " << i << endl; cout << " Pixel Number in the island: " << fPixNum[i] << endl; cout << " Signal to Noise of the island : " << fSigToNoise[i] << endl; } return 1; }