39 #include "Riostream.h" 43 #include "TGeoMatrix.h" 46 #include "TObjArray.h" 47 #include "TPolyLine.h" 57 void Plot(TPolyLine& line, Bool_t orientation)
65 Double_t* x = line.GetX();
66 Double_t* y = line.GetY();
68 for ( Int_t i = 0; i < line.GetLastPoint(); ++i )
77 TLine* a =
new TArrow(x1,y1,x2,y2,0.03,
"->-");
110 AliInfo(
"Resetting all timers before I start...");
118 AliInfo(
"Resetting all timers after loading the mapping...");
126 Bool_t explodedView(kTRUE);
128 if (sopt.Contains(
"REAL")) explodedView = kFALSE;
132 if ( sopt.Contains(
"SAVE") )
134 TFile f2(
"AliMUONContourMakerTest.manuContours.root",
"RECREATE");
146 Double_t& xmin, Double_t& ymin,
147 Double_t& xmax, Double_t& ymax,
148 Bool_t enlarge)
const 159 while ( ( contour = static_cast<AliMUONContour*>(next()) ) )
162 xmin = TMath::Min(xmin,area.LeftBorder());
163 xmax = TMath::Max(xmax,area.RightBorder());
164 ymin = TMath::Min(ymin,area.DownBorder());
165 ymax = TMath::Max(ymax,area.UpBorder());
170 Double_t xsize = (xmax-xmin);
171 Double_t ysize = (ymax-ymin);
172 Double_t xshift = xsize*0.1;
173 Double_t yshift = ysize*0.1;
176 xmax = xmin + xsize + xshift*2;
177 ymax = ymin + ysize + yshift*2;
187 TIter next(&segments);
189 while ( ( s = static_cast<AliMUONSegment*>(next()) ) )
191 TPolyLine* line =
new TPolyLine(2);
193 line->SetPoint(1,s->
EndX(),s->
EndY());
194 line->SetLineColor(lineColor);
195 line->SetLineWidth(lineWidth);
196 ::Plot(*line,orientation);
203 Int_t lineColor, Int_t lineWidth,
204 Bool_t orientation)
const 210 line->SetPoint(i,polygon.
X(i),polygon.
Y(i));
213 line->SetLineColor(lineColor);
214 line->SetLineWidth(lineWidth);
216 if ( orientation )
::Plot(*line,kTRUE);
222 Bool_t orientation)
const 226 TIter next(polygons);
228 while ( ( pol = static_cast<AliMUONPolygon*>(next()) ) )
230 Plot(*pol,lineColor,lineWidth,orientation);
241 while ( ( contour = static_cast<AliMUONContour*>(next()) ) )
243 Plot(*contour,5,4,orientations);
253 TCanvas* c =
new TCanvas(basename,basename,0,0,600,600);
254 double xmin,ymin,xmax,ymax;
256 c->Range(xmin,ymin,xmax,ymax);
260 TString name(Form(
"%s",basename));
261 name.ReplaceAll(
"/",
"_");
262 c->Print(Form(
"%s.png",name.Data()));
263 if ( verticals || horizontals )
270 name = Form(
"%s",basename);
271 name.ReplaceAll(
"/",
"_");
272 c->Print(Form(
"%s-segments.png",name.Data()));
Double_t EndX() const
Return the x-coordinate of our ending point.
Double_t Y(Int_t i) const
Return the y-coordinate of the i-th vertex.
void Print(Option_t *opt="") const
Print the list of timers we manage.
TMap * AllContourMap() const
Get all the contours as a map.
static Bool_t AreEqual(double a, double b)
void GetBoundingBox(const TObjArray &array, Double_t &xmin, Double_t &ymin, Double_t &xmax, Double_t &ymax, Bool_t enlarge=kFALSE) const
Test of ContourMaker classes.
void Plot(const AliMUONContour &contour, Int_t lineColor=5, Int_t lineWidth=4, Bool_t orientation=kFALSE) const
void PlotSegments(const TObjArray &segments, Int_t lineColor=1, Int_t lineWidth=2, Bool_t orientations=kFALSE) const
A rectangle area positioned in plane..
static Bool_t LoadDDLStore2(const char *cdbpath="local://$ALICE_ROOT/OCDB", Int_t runNumber=0, Bool_t warn=false)
Double_t StartY() const
Return the y-coordinate of our starting point.
virtual ~AliMUONContourMakerTest()
void Exec(const Option_t *opt="ALL")
Double_t StartX() const
Return the x-coordinate of our starting point.
Int_t NumberOfVertices() const
Get the number of vertices of this polygon.
Double_t X(Int_t i) const
Return the x-coordinate of the i-th vertex.
A basic line segment, used for contour making algorithm(s)
void PlotContours(const TObjArray &array, Bool_t orientations=kFALSE) const
#define AliCodeTimerAuto(message, counter)
void PrintAsPNG(const char *basename, const TObjArray &contourArray, const TObjArray *contourVerticalEdges=0x0, const TObjArray *horizontals=0x0) const
const TObjArray * Polygons() const
Get the list of polygons we have.
Holder for MUON tracker contours.
static AliCodeTimer * Instance()
Unique instance of this class, which is a singleton.
void Reset()
Reset all our timers.
AliMUONContourMakerTest()
Double_t EndY() const
Return the y-coordinate of our ending point.
TH1 ** Plot(const AliMUONVStore &store, const char *name, Int_t nbins)