1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
20 // Test macro for drawing slat motifs with real contours
21 // Christian Finck, Subatech
23 #if !defined(__CINT__) || defined(__MAKECINT__)
26 #include "AliMpSt345Reader.h"
27 #include "AliMpSlat.h"
28 #include "AliMpVPainter.h"
29 #include "AliMpMotifReader.h"
30 #include "AliMpMotifType.h"
31 #include "AliMpMotifPosition.h"
32 #include "AliMpMotif.h"
37 void testGraphicsMotif(Option_t* motifType = "R43", const TVector2& padSizes = TVector2(2.5,0.5))
39 // Warning : this function leaks memory. But should be fine as only used
40 // interactively to check a few motifs at once...
42 AliMpMotifReader reader(AliMp::kStation345,AliMp::kBendingPlane);
43 AliMpMotifType* type = reader.BuildMotifType(motifType);
46 cerr << "Motif not found" << endl;
49 AliMpMotif* motif = new AliMpMotif(motifType,type,padSizes);
50 AliMpMotifPosition* pos = new AliMpMotifPosition(0,motif,TVector2(0,0));
51 AliMpVPainter* painter = AliMpVPainter::CreatePainter(pos);
54 cerr << "Could not get a painter !" << endl;
57 TCanvas* c = new TCanvas();
66 void testGraphicsSlat(AliMpPlaneType planeType = AliMp::kBendingPlane,
67 Option_t* option = "PMCI",
68 Bool_t saveJPG = false)
75 Char_t *slatName[19] = {"122000SR1", "112200SR2", "122200S", "222000N", "220000N",
76 "122000NR1", "112200NR2", "122200N",
77 "122330N", "112233NR3", "112230N", "222330N", "223300N", "333000N", "330000N",
78 "112233N", "222333N", "223330N", "333300N"};
82 Char_t c1NameJpg[255];
84 for (Int_t i = 0; i < 19; i++) {
85 sprintf(c1Name, "%s%d", "c1", i);
86 c1[i]= new TCanvas(c1Name,slatName[i],10,10,1200,800);
88 Char_t* slatType = slatName[i];
89 AliMpSt345Reader* reader = new AliMpSt345Reader();
90 AliMpSlat* slat = reader->ReadSlat(slatType, planeType);
91 AliMpVPainter* painter = AliMpVPainter::CreatePainter(slat);
92 painter->Draw(option);
94 if (planeType == kNonBendingPlane)
95 sprintf(c1NameJpg, "%s%s", slatName[i], "_NonBending.jpg");
97 sprintf(c1NameJpg, "%s%s", slatName[i], "_Bending.jpg");
99 if (saveJPG) c1[i]->Print(c1NameJpg);