scripts/CheckRaw.C

Go to the documentation of this file.
00001 //____________________________________________________________________
00002 //
00003 // $Id: CheckRaw.C,v 1.1 2006/03/23 17:10:48 cholm Exp $
00004 //
00005 // Script that contains a class to compare the raw data written to the
00006 // digits it's created from.
00007 //
00008 // Use the script `Compile.C' to compile this class using ACLic. 
00009 //
00010 #include <AliLog.h>
00011 #include <AliFMDDigit.h>
00012 #include <AliFMDInput.h>
00013 #include <AliFMDUShortMap.h>
00014 #include <AliFMDParameters.h>
00015 #include <iostream>
00016 #include <TStyle.h>
00017 #include <TArrayF.h>
00018 #include <TCanvas.h>
00019 
00030 class CheckRaw : public AliFMDInput
00031 {
00032 public:
00033   CheckRaw()
00034   {
00035     AddLoad(kDigits);
00036     AddLoad(kRaw);
00037   }
00038   Bool_t Init() 
00039   {
00040     Bool_t ret = AliFMDInput::Init();
00041     // AliFMDGeometry* geom = AliFMDGeometry::Instance();
00042     // geom->Init();
00043     // geom->InitTransformations();
00044     AliFMDParameters* param = AliFMDParameters::Instance();
00045     param->Init();
00046     return ret;
00047   }
00048   Bool_t ProcessDigit(AliFMDDigit* digit)
00049   {
00050     // Cache the energy loss 
00051     if (!digit) return kFALSE;
00052     UShort_t det = digit->Detector();
00053     Char_t   rng = digit->Ring();
00054     UShort_t sec = digit->Sector();
00055     UShort_t str = digit->Strip();
00056     if (str > 511) {
00057       AliWarning(Form("Bad strip number %d in digit", str));
00058       return kTRUE;
00059     }
00060     fMap(det, rng, sec, str) = digit->Counts();
00061     return kTRUE;
00062   }
00063   Bool_t ProcessRawDigit(AliFMDDigit* digit)
00064   {
00065     // Cache the energy loss 
00066     if (!digit) return kFALSE;
00067     UShort_t det = digit->Detector();
00068     Char_t   rng = digit->Ring();
00069     UShort_t sec = digit->Sector();
00070     UShort_t str = digit->Strip();
00071     if (str > 511) {
00072       AliWarning(Form("Bad strip number %d in digit", str));
00073       return kTRUE;
00074     }
00075     if (digit->Counts() != fMap(det, rng, sec, str) && 
00076         fMap(det, rng, sec, str) != 1024) {
00077       AliWarning(Form("Mismatch in digit FMD%d%c[%2d,%3d] %d != %d", 
00078                       det, rng, sec, str, digit->Counts(), 
00079                       fMap(det, rng, sec, str)));
00080       return kTRUE;
00081     }
00082     AliDebug(1, Form("Raw digit FMD%d%c[%2d,%3D] is good", 
00083                      det, rng, sec, str));
00084     return kTRUE;
00085   }
00086 protected:
00087   AliFMDUShortMap fMap;
00088 };
00089 
00090 
00091 //____________________________________________________________________
00092 //
00093 // EOF
00094 //
00095 
00096 
00097   
00098   

Generated on Fri Mar 24 17:11:21 2006 for ALICE FMD Off-line by  doxygen 1.4.6