00001
00002
00003
00004
00005
00006
00007
00008 #include <string.h>
00009 #include <map>
00010 #include <string>
00011 #include "TH1I.h"
00012 #include "TH2I.h"
00013 #include "mTypes.h"
00014
00015 #include "root/MTChannel.hh"
00016
00017
00018 class Detector;
00019
00020
00021 #ifndef _COMMANDOPTION_HH
00022 #define _COMMANDOPTION_HH
00023
00024
00025 #define TIMECUT 1
00026
00027 class MTEvent;
00028
00029 class BeamProfile {
00030 public:
00031 BeamProfile();
00032 BeamProfile(int argc, char **argv);
00033 BeamProfile(const BeamProfile& orig);
00034
00035 void SetDetector( Detector* det) ;
00036
00037
00038 inline std::string getFileName() { return fileName; };
00039 inline std::string getXMLFileName() { return xmlFileName; };
00040 inline unsigned int getTimeCutMin() { return timeCutMin;};
00041 inline unsigned int getTimeCutMax() { return timeCutMax;};
00042 inline bool getShowRunInfo() { return showRunInfo;};
00043 inline bool getShowXYDistribution() { return showXYDistribution;};
00044 inline bool getShowDeltaDistribution() { return showDeltaDistribution;};
00045 inline bool getShowHitPerChipDistribution() { return showHitPerChipDistribution;};
00046 inline bool getShowHitPerChannelDistribution() { return showHitPerChannelDistribution;};
00047 inline int getChamberId() { return chamberId;};
00048 inline int getDifId() { return difId;};
00049 inline int getBoardId() { return boardId;};
00050 inline int getChipId() { return chipId;};
00051
00052
00053 bool FillXyDist( const MTChannel &channel);
00054 bool FillHitPerChipDist(const MTChannel &channel);
00055 bool FillHitPerChannel(const MTChannel &channel);
00056 bool FillDeltaT(const MTChannel &channel);
00057 bool FillHotChamber(const MTEvent& evt);
00058 bool FillHotChip( const MTChannel &channel);
00059
00060 unsigned int GetHotChamber(const MTEvent& evt);
00061
00062 void DrawXyDist(void);
00063 void DrawHitPerChipDist();
00064 void DrawHitPerChannelDist();
00065 void DrawChannel2D();
00066 void DrawChip2D();
00067 void DrawDeltaT();
00068 void DrawHotChamber();
00069
00070 void PrintHotChip() const;
00071
00072 virtual ~BeamProfile();
00073 private:
00074 void parseOptions();
00075 void askOptions();
00076 int getNbHist();
00077 bool filterOnId(const MTChannel &channel);
00078 bool filterOnCut(const MTChannel &channel);
00079
00080
00081 private:
00082 int nbArgs;
00083 char **args;
00084
00085 std::string fileName;
00086 std::string xmlFileName;
00087 unsigned int timeCutMin;
00088 unsigned int timeCutMax;
00089 int analogCutMin;
00090 int analogCutMax;
00091 int maxHistogram;
00092
00093 bool analogCut;
00094 bool timeCut;
00095 bool showRunInfo;
00096 bool showXYDistribution;
00097 bool showDeltaDistribution;
00098 int nbhit;
00099 int adc;
00100 bool showHitPerChipDistribution;
00101 bool showHitPerChannelDistribution;
00102 bool showHotChamber;
00103 bool showHotChip;
00104 int chamberId;
00105 int difId;
00106 int boardId;
00107 int chipId;
00108
00109 const Detector* detector;
00110
00111 std::map<ui16,TH2I*> xyKeyChamber;
00112 std::map<ui32,TH1I*> hitPerChipKeyChamberDif;
00113 std::map<ui32,TH1I*> hitPerChannelKeyChip;
00114 ui32 maxHitPerChannel;
00115 ui32 minHitPerChannel;
00116 std::map<ui32,TH1I*> deltaTKeyChip;
00117
00118 TH1I *chamberHotHist;
00119
00120 int minDeltaTValue;
00121 int maxDeltaTValue;
00122 int minHitPerChannelValue;
00123 int maxHitPerChannelValue;
00124 int maxHitPerChip;
00125 int minHitPerChip;
00126 std::map <std::string,int> minHitPerChipValue;
00127 std::map <std::string,int> maxHitPerChipValue;
00128 std::map<ui16,std::map<std::string,int>* > nbHitPerChipPerChamber;
00129
00130
00131 std::map<std::string,std::map<Int_t ,Int_t>* > hitPerChipKeyChamberDifMap;
00132 std::map<std::string,std::map<Int_t ,Int_t>* > deltaTKeyChipMap;
00133 std::map<std::string,std::map<Int_t ,Int_t>* > hitPerChannelKeyChipMap;
00134 };
00135
00136 #endif
00137