#include "AliMUONBusPatchPainter.h"
#include "AliMUONManuPainter.h"
#include "AliMUONContour.h"
#include "AliMUONPainterHelper.h"
#include "AliMUONVCalibParam.h"
#include "AliMUONVTrackerData.h"
#include "AliMpBusPatch.h"
#include "AliMpConstants.h"
#include "AliMpDDLStore.h"
#include "AliMpDEManager.h"
#include "AliMpPlaneType.h"
#include "AliLog.h"
#include <TObjArray.h>
#include <TString.h>
#include <float.h>
ClassImp(AliMUONBusPatchPainter)
AliMUONBusPatchPainter::AliMUONBusPatchPainter()
: AliMUONVPainter(),
fBusPatchId(-1)
{
}
AliMUONBusPatchPainter::AliMUONBusPatchPainter(TRootIOCtor* ioCtor)
: AliMUONVPainter(ioCtor),
fBusPatchId(-1)
{
}
AliMUONBusPatchPainter::AliMUONBusPatchPainter(const AliMUONAttPainter& att,
Int_t busPatchId)
: AliMUONVPainter("BUSPATCH"),
fBusPatchId(busPatchId)
{
SetAttributes(Validate(att));
AliMp::PlaneType planeType = ( Attributes().IsBendingPlane() ? AliMp::kBendingPlane : AliMp::kNonBendingPlane );
Int_t detElemId = AliMpDDLStore::Instance()->GetDEfromBus(busPatchId);
AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
SetID(busPatchId,-1);
SetName(h->BusPatchName(busPatchId));
SetPathName(h->BusPatchPathName(busPatchId));
AliMpBusPatch* busPatch = AliMpDDLStore::Instance()->GetBusPatch(fBusPatchId);
Int_t mask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
AliMUONContour* bpContour = h->GetContour(ContourName());
AliDebug(1,Form("BusPatchId %04d bending %d DE %4d bpContour(%s)=%p nofManus=%d",
fBusPatchId,att.IsBendingPlane(),detElemId,ContourName().Data(),bpContour,busPatch->GetNofManus()));
Double_t xmin(FLT_MAX), ymin(FLT_MAX), xmax(-FLT_MAX), ymax(-FLT_MAX);
TObjArray contours;
Int_t nmanus(0);
for ( Int_t i = 0; i < busPatch->GetNofManus(); ++i )
{
Int_t manuId = busPatch->GetManuId(i);
Bool_t correctPlane(kTRUE);
if ( planeType == AliMp::kNonBendingPlane )
{
if ( ( manuId & mask ) == 0 ) correctPlane = kFALSE;
}
else
{
if ( ( manuId & mask ) == mask ) correctPlane = kFALSE;
}
AliDebug(1,Form("Adding Manu %04d to BusPatch %04d (DE %04d) "
"manu & mask = %d correctPlane %d planeType %s",
manuId,fBusPatchId,busPatch->GetDEId(),
(manuId & mask),correctPlane,AliMp::PlaneTypeName(planeType).Data()));
if (!correctPlane) continue;
++nmanus;
AliMUONVPainter* painter = new AliMUONManuPainter(Attributes(),
busPatch->GetDEId(),
manuId);
Add(painter);
const AliMpArea& area = painter->Area();
xmin = TMath::Min(xmin,area.LeftBorder());
ymin = TMath::Min(ymin,area.DownBorder());
xmax = TMath::Max(xmax,area.RightBorder());
ymax = TMath::Max(ymax,area.UpBorder());
if (!bpContour)
{
contours.Add(painter->Contour());
}
}
if ( !nmanus )
{
Invalidate();
return;
}
if (!bpContour)
{
AliDebug(1,Form("Creating contour %s",ContourName().Data()));
bpContour = h->MergeContours(contours,ContourName());
if (!bpContour)
{
AliError("Could not merge those contours");
StdoutToAliError(contours.Print(););
}
}
SetContour(bpContour);
}
void
AliMUONBusPatchPainter::ComputeDataRange(const AliMUONVTrackerData& data, Int_t dataIndex,
Double_t& dataMin, Double_t& dataMax) const
{
dataMin = dataMax = data.BusPatch(fBusPatchId, dataIndex);
}
AliMUONBusPatchPainter::AliMUONBusPatchPainter(const AliMUONBusPatchPainter& rhs)
: AliMUONVPainter(rhs), fBusPatchId(-1)
{
rhs.Copy(*this);
}
AliMUONBusPatchPainter&
AliMUONBusPatchPainter::operator=(const AliMUONBusPatchPainter& rhs)
{
if ( this != &rhs )
{
rhs.Copy(*this);
}
return *this;
}
AliMUONBusPatchPainter::~AliMUONBusPatchPainter()
{
}
void
AliMUONBusPatchPainter::Copy(TObject& object) const
{
AliMUONVPainter::Copy((AliMUONVPainter&)(object));
((AliMUONBusPatchPainter&)(object)).fBusPatchId = fBusPatchId;
}
Bool_t
AliMUONBusPatchPainter::IsIncluded() const
{
return ( InteractiveReadOutConfig()->BusPatch(fBusPatchId) > 0 );
}
TString
AliMUONBusPatchPainter::Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
Double_t, Double_t)
{
if (!data.HasBusPatch(fBusPatchId)) return "";
Double_t value = data.BusPatch(fBusPatchId,dataIndex);
return AliMUONPainterHelper::Instance()->FormatValue(data.DimensionName(dataIndex).Data(),value);
}
void
AliMUONBusPatchPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
Double_t min, Double_t max)
{
if (!data.HasBusPatch(fBusPatchId)) return;
Double_t value = data.BusPatch(fBusPatchId,dataIndex);
if ( value >= AliMUONVCalibParam::InvalidFloatValue() ) return;
Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
PaintArea(color);
}
AliMUONAttPainter
AliMUONBusPatchPainter::Validate(const AliMUONAttPainter& attributes) const
{
AliMUONAttPainter norm(attributes);
Int_t detElemId = AliMpDDLStore::Instance()->GetDEfromBus(fBusPatchId);
if (!norm.IsValid()) return norm;
if ( !norm.IsCathodeDefined() )
{
AliMp::PlaneType planeType = ( norm.IsBendingPlane() ? AliMp::kBendingPlane : AliMp::kNonBendingPlane );
AliMp::CathodType cathodeType = AliMpDEManager::GetCathod(detElemId,planeType);
Bool_t cath0 = ( cathodeType == AliMp::kCath0 );
norm.SetCathode(cath0,!cath0);
}
else if ( !norm.IsPlaneDefined() )
{
AliMp::CathodType cathodeType = ( norm.IsCathode0() ? AliMp::kCath0 : AliMp::kCath1 );
AliMp::PlaneType planeType = AliMpDEManager::GetPlaneType(detElemId,cathodeType);
Bool_t bending = ( planeType == AliMp::kBendingPlane );
norm.SetPlane(bending,!bending);
}
AliMpBusPatch* busPatch = AliMpDDLStore::Instance()->GetBusPatch(fBusPatchId);
Int_t mask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
Int_t nb(0);
Int_t b(0);
for ( Int_t i = 0; i < busPatch->GetNofManus(); ++i )
{
Int_t manuId = busPatch->GetManuId(i);
if ( manuId & mask ) ++nb;
else ++b;
}
if ( norm.IsBendingPlane() && !b ) norm.SetValid(kFALSE);
if ( norm.IsNonBendingPlane() && !nb ) norm.SetValid(kFALSE);
return norm;
}
AliMUONBusPatchPainter.cxx:1 AliMUONBusPatchPainter.cxx:2 AliMUONBusPatchPainter.cxx:3 AliMUONBusPatchPainter.cxx:4 AliMUONBusPatchPainter.cxx:5 AliMUONBusPatchPainter.cxx:6 AliMUONBusPatchPainter.cxx:7 AliMUONBusPatchPainter.cxx:8 AliMUONBusPatchPainter.cxx:9 AliMUONBusPatchPainter.cxx:10 AliMUONBusPatchPainter.cxx:11 AliMUONBusPatchPainter.cxx:12 AliMUONBusPatchPainter.cxx:13 AliMUONBusPatchPainter.cxx:14 AliMUONBusPatchPainter.cxx:15 AliMUONBusPatchPainter.cxx:16 AliMUONBusPatchPainter.cxx:17 AliMUONBusPatchPainter.cxx:18 AliMUONBusPatchPainter.cxx:19 AliMUONBusPatchPainter.cxx:20 AliMUONBusPatchPainter.cxx:21 AliMUONBusPatchPainter.cxx:22 AliMUONBusPatchPainter.cxx:23 AliMUONBusPatchPainter.cxx:24 AliMUONBusPatchPainter.cxx:25 AliMUONBusPatchPainter.cxx:26 AliMUONBusPatchPainter.cxx:27 AliMUONBusPatchPainter.cxx:28 AliMUONBusPatchPainter.cxx:29 AliMUONBusPatchPainter.cxx:30 AliMUONBusPatchPainter.cxx:31 AliMUONBusPatchPainter.cxx:32 AliMUONBusPatchPainter.cxx:33 AliMUONBusPatchPainter.cxx:34 AliMUONBusPatchPainter.cxx:35 AliMUONBusPatchPainter.cxx:36 AliMUONBusPatchPainter.cxx:37 AliMUONBusPatchPainter.cxx:38 AliMUONBusPatchPainter.cxx:39 AliMUONBusPatchPainter.cxx:40 AliMUONBusPatchPainter.cxx:41 AliMUONBusPatchPainter.cxx:42 AliMUONBusPatchPainter.cxx:43 AliMUONBusPatchPainter.cxx:44 AliMUONBusPatchPainter.cxx:45 AliMUONBusPatchPainter.cxx:46 AliMUONBusPatchPainter.cxx:47 AliMUONBusPatchPainter.cxx:48 AliMUONBusPatchPainter.cxx:49 AliMUONBusPatchPainter.cxx:50 AliMUONBusPatchPainter.cxx:51 AliMUONBusPatchPainter.cxx:52 AliMUONBusPatchPainter.cxx:53 AliMUONBusPatchPainter.cxx:54 AliMUONBusPatchPainter.cxx:55 AliMUONBusPatchPainter.cxx:56 AliMUONBusPatchPainter.cxx:57 AliMUONBusPatchPainter.cxx:58 AliMUONBusPatchPainter.cxx:59 AliMUONBusPatchPainter.cxx:60 AliMUONBusPatchPainter.cxx:61 AliMUONBusPatchPainter.cxx:62 AliMUONBusPatchPainter.cxx:63 AliMUONBusPatchPainter.cxx:64 AliMUONBusPatchPainter.cxx:65 AliMUONBusPatchPainter.cxx:66 AliMUONBusPatchPainter.cxx:67 AliMUONBusPatchPainter.cxx:68 AliMUONBusPatchPainter.cxx:69 AliMUONBusPatchPainter.cxx:70 AliMUONBusPatchPainter.cxx:71 AliMUONBusPatchPainter.cxx:72 AliMUONBusPatchPainter.cxx:73 AliMUONBusPatchPainter.cxx:74 AliMUONBusPatchPainter.cxx:75 AliMUONBusPatchPainter.cxx:76 AliMUONBusPatchPainter.cxx:77 AliMUONBusPatchPainter.cxx:78 AliMUONBusPatchPainter.cxx:79 AliMUONBusPatchPainter.cxx:80 AliMUONBusPatchPainter.cxx:81 AliMUONBusPatchPainter.cxx:82 AliMUONBusPatchPainter.cxx:83 AliMUONBusPatchPainter.cxx:84 AliMUONBusPatchPainter.cxx:85 AliMUONBusPatchPainter.cxx:86 AliMUONBusPatchPainter.cxx:87 AliMUONBusPatchPainter.cxx:88 AliMUONBusPatchPainter.cxx:89 AliMUONBusPatchPainter.cxx:90 AliMUONBusPatchPainter.cxx:91 AliMUONBusPatchPainter.cxx:92 AliMUONBusPatchPainter.cxx:93 AliMUONBusPatchPainter.cxx:94 AliMUONBusPatchPainter.cxx:95 AliMUONBusPatchPainter.cxx:96 AliMUONBusPatchPainter.cxx:97 AliMUONBusPatchPainter.cxx:98 AliMUONBusPatchPainter.cxx:99 AliMUONBusPatchPainter.cxx:100 AliMUONBusPatchPainter.cxx:101 AliMUONBusPatchPainter.cxx:102 AliMUONBusPatchPainter.cxx:103 AliMUONBusPatchPainter.cxx:104 AliMUONBusPatchPainter.cxx:105 AliMUONBusPatchPainter.cxx:106 AliMUONBusPatchPainter.cxx:107 AliMUONBusPatchPainter.cxx:108 AliMUONBusPatchPainter.cxx:109 AliMUONBusPatchPainter.cxx:110 AliMUONBusPatchPainter.cxx:111 AliMUONBusPatchPainter.cxx:112 AliMUONBusPatchPainter.cxx:113 AliMUONBusPatchPainter.cxx:114 AliMUONBusPatchPainter.cxx:115 AliMUONBusPatchPainter.cxx:116 AliMUONBusPatchPainter.cxx:117 AliMUONBusPatchPainter.cxx:118 AliMUONBusPatchPainter.cxx:119 AliMUONBusPatchPainter.cxx:120 AliMUONBusPatchPainter.cxx:121 AliMUONBusPatchPainter.cxx:122 AliMUONBusPatchPainter.cxx:123 AliMUONBusPatchPainter.cxx:124 AliMUONBusPatchPainter.cxx:125 AliMUONBusPatchPainter.cxx:126 AliMUONBusPatchPainter.cxx:127 AliMUONBusPatchPainter.cxx:128 AliMUONBusPatchPainter.cxx:129 AliMUONBusPatchPainter.cxx:130 AliMUONBusPatchPainter.cxx:131 AliMUONBusPatchPainter.cxx:132 AliMUONBusPatchPainter.cxx:133 AliMUONBusPatchPainter.cxx:134 AliMUONBusPatchPainter.cxx:135 AliMUONBusPatchPainter.cxx:136 AliMUONBusPatchPainter.cxx:137 AliMUONBusPatchPainter.cxx:138 AliMUONBusPatchPainter.cxx:139 AliMUONBusPatchPainter.cxx:140 AliMUONBusPatchPainter.cxx:141 AliMUONBusPatchPainter.cxx:142 AliMUONBusPatchPainter.cxx:143 AliMUONBusPatchPainter.cxx:144 AliMUONBusPatchPainter.cxx:145 AliMUONBusPatchPainter.cxx:146 AliMUONBusPatchPainter.cxx:147 AliMUONBusPatchPainter.cxx:148 AliMUONBusPatchPainter.cxx:149 AliMUONBusPatchPainter.cxx:150 AliMUONBusPatchPainter.cxx:151 AliMUONBusPatchPainter.cxx:152 AliMUONBusPatchPainter.cxx:153 AliMUONBusPatchPainter.cxx:154 AliMUONBusPatchPainter.cxx:155 AliMUONBusPatchPainter.cxx:156 AliMUONBusPatchPainter.cxx:157 AliMUONBusPatchPainter.cxx:158 AliMUONBusPatchPainter.cxx:159 AliMUONBusPatchPainter.cxx:160 AliMUONBusPatchPainter.cxx:161 AliMUONBusPatchPainter.cxx:162 AliMUONBusPatchPainter.cxx:163 AliMUONBusPatchPainter.cxx:164 AliMUONBusPatchPainter.cxx:165 AliMUONBusPatchPainter.cxx:166 AliMUONBusPatchPainter.cxx:167 AliMUONBusPatchPainter.cxx:168 AliMUONBusPatchPainter.cxx:169 AliMUONBusPatchPainter.cxx:170 AliMUONBusPatchPainter.cxx:171 AliMUONBusPatchPainter.cxx:172 AliMUONBusPatchPainter.cxx:173 AliMUONBusPatchPainter.cxx:174 AliMUONBusPatchPainter.cxx:175 AliMUONBusPatchPainter.cxx:176 AliMUONBusPatchPainter.cxx:177 AliMUONBusPatchPainter.cxx:178 AliMUONBusPatchPainter.cxx:179 AliMUONBusPatchPainter.cxx:180 AliMUONBusPatchPainter.cxx:181 AliMUONBusPatchPainter.cxx:182 AliMUONBusPatchPainter.cxx:183 AliMUONBusPatchPainter.cxx:184 AliMUONBusPatchPainter.cxx:185 AliMUONBusPatchPainter.cxx:186 AliMUONBusPatchPainter.cxx:187 AliMUONBusPatchPainter.cxx:188 AliMUONBusPatchPainter.cxx:189 AliMUONBusPatchPainter.cxx:190 AliMUONBusPatchPainter.cxx:191 AliMUONBusPatchPainter.cxx:192 AliMUONBusPatchPainter.cxx:193 AliMUONBusPatchPainter.cxx:194 AliMUONBusPatchPainter.cxx:195 AliMUONBusPatchPainter.cxx:196 AliMUONBusPatchPainter.cxx:197 AliMUONBusPatchPainter.cxx:198 AliMUONBusPatchPainter.cxx:199 AliMUONBusPatchPainter.cxx:200 AliMUONBusPatchPainter.cxx:201 AliMUONBusPatchPainter.cxx:202 AliMUONBusPatchPainter.cxx:203 AliMUONBusPatchPainter.cxx:204 AliMUONBusPatchPainter.cxx:205 AliMUONBusPatchPainter.cxx:206 AliMUONBusPatchPainter.cxx:207 AliMUONBusPatchPainter.cxx:208 AliMUONBusPatchPainter.cxx:209 AliMUONBusPatchPainter.cxx:210 AliMUONBusPatchPainter.cxx:211 AliMUONBusPatchPainter.cxx:212 AliMUONBusPatchPainter.cxx:213 AliMUONBusPatchPainter.cxx:214 AliMUONBusPatchPainter.cxx:215 AliMUONBusPatchPainter.cxx:216 AliMUONBusPatchPainter.cxx:217 AliMUONBusPatchPainter.cxx:218 AliMUONBusPatchPainter.cxx:219 AliMUONBusPatchPainter.cxx:220 AliMUONBusPatchPainter.cxx:221 AliMUONBusPatchPainter.cxx:222 AliMUONBusPatchPainter.cxx:223 AliMUONBusPatchPainter.cxx:224 AliMUONBusPatchPainter.cxx:225 AliMUONBusPatchPainter.cxx:226 AliMUONBusPatchPainter.cxx:227 AliMUONBusPatchPainter.cxx:228 AliMUONBusPatchPainter.cxx:229 AliMUONBusPatchPainter.cxx:230 AliMUONBusPatchPainter.cxx:231 AliMUONBusPatchPainter.cxx:232 AliMUONBusPatchPainter.cxx:233 AliMUONBusPatchPainter.cxx:234 AliMUONBusPatchPainter.cxx:235 AliMUONBusPatchPainter.cxx:236 AliMUONBusPatchPainter.cxx:237 AliMUONBusPatchPainter.cxx:238 AliMUONBusPatchPainter.cxx:239 AliMUONBusPatchPainter.cxx:240 AliMUONBusPatchPainter.cxx:241 AliMUONBusPatchPainter.cxx:242 AliMUONBusPatchPainter.cxx:243 AliMUONBusPatchPainter.cxx:244 AliMUONBusPatchPainter.cxx:245 AliMUONBusPatchPainter.cxx:246 AliMUONBusPatchPainter.cxx:247 AliMUONBusPatchPainter.cxx:248 AliMUONBusPatchPainter.cxx:249 AliMUONBusPatchPainter.cxx:250 AliMUONBusPatchPainter.cxx:251 AliMUONBusPatchPainter.cxx:252 AliMUONBusPatchPainter.cxx:253 AliMUONBusPatchPainter.cxx:254 AliMUONBusPatchPainter.cxx:255 AliMUONBusPatchPainter.cxx:256 AliMUONBusPatchPainter.cxx:257 AliMUONBusPatchPainter.cxx:258 AliMUONBusPatchPainter.cxx:259 AliMUONBusPatchPainter.cxx:260 AliMUONBusPatchPainter.cxx:261 AliMUONBusPatchPainter.cxx:262 AliMUONBusPatchPainter.cxx:263 AliMUONBusPatchPainter.cxx:264 AliMUONBusPatchPainter.cxx:265 AliMUONBusPatchPainter.cxx:266 AliMUONBusPatchPainter.cxx:267 AliMUONBusPatchPainter.cxx:268 AliMUONBusPatchPainter.cxx:269 AliMUONBusPatchPainter.cxx:270 AliMUONBusPatchPainter.cxx:271 AliMUONBusPatchPainter.cxx:272 AliMUONBusPatchPainter.cxx:273 AliMUONBusPatchPainter.cxx:274 AliMUONBusPatchPainter.cxx:275 AliMUONBusPatchPainter.cxx:276 AliMUONBusPatchPainter.cxx:277 AliMUONBusPatchPainter.cxx:278 AliMUONBusPatchPainter.cxx:279 AliMUONBusPatchPainter.cxx:280 AliMUONBusPatchPainter.cxx:281 AliMUONBusPatchPainter.cxx:282 AliMUONBusPatchPainter.cxx:283 AliMUONBusPatchPainter.cxx:284 AliMUONBusPatchPainter.cxx:285 AliMUONBusPatchPainter.cxx:286 AliMUONBusPatchPainter.cxx:287 AliMUONBusPatchPainter.cxx:288 AliMUONBusPatchPainter.cxx:289 AliMUONBusPatchPainter.cxx:290 AliMUONBusPatchPainter.cxx:291 AliMUONBusPatchPainter.cxx:292 AliMUONBusPatchPainter.cxx:293 AliMUONBusPatchPainter.cxx:294 AliMUONBusPatchPainter.cxx:295 AliMUONBusPatchPainter.cxx:296 AliMUONBusPatchPainter.cxx:297 AliMUONBusPatchPainter.cxx:298 AliMUONBusPatchPainter.cxx:299 AliMUONBusPatchPainter.cxx:300 AliMUONBusPatchPainter.cxx:301 AliMUONBusPatchPainter.cxx:302 AliMUONBusPatchPainter.cxx:303 AliMUONBusPatchPainter.cxx:304 AliMUONBusPatchPainter.cxx:305