+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
// $Id$
//
// Class AliMUONGeometryEnvelopeStore
#include <Riostream.h>
#include "AliMUONGeometryEnvelopeStore.h"
-#include "AliMUONGeometryTransformStore.h"
#include "AliMUONGeometryEnvelope.h"
+#include "AliMUONGeometryDetElement.h"
+#include "AliMUONGeometryStore.h"
#include "AliMUONConstants.h"
+#include "AliLog.h"
ClassImp(AliMUONGeometryEnvelopeStore)
//______________________________________________________________________________
AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore(
- AliMUONGeometryTransformStore* transforms)
+ AliMUONGeometryStore* detElements)
: TObject(),
- fDETransforms(transforms),
fEnvelopes(0),
+ fDetElements(detElements),
fDebug(false),
fAlign(false)
{
//______________________________________________________________________________
AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore()
: TObject(),
- fDETransforms(0),
fEnvelopes(0),
+ fDetElements(0),
fDebug(false),
fAlign(false)
{
AliMUONGeometryEnvelopeStore::AliMUONGeometryEnvelopeStore(const AliMUONGeometryEnvelopeStore& rhs)
: TObject(rhs)
{
- Fatal("Copy constructor",
- "Copy constructor is not implemented.");
+ AliFatal("Copy constructor is not implemented.");
}
//______________________________________________________________________________
// check assignement to self
if (this == &rhs) return *this;
- Fatal("operator=",
- "Assignment operator is not implemented.");
+ AliFatal("Assignment operator is not implemented.");
return *this;
}
Int_t detElemId = envelope->GetUniqueID();
if (detElemId == 0) return false;
- const TGeoCombiTrans* kTransform = fDETransforms->Get(detElemId);
- if (!kTransform) {
- Warning("AlignEnvelope", "Transformation not found.");
+ AliMUONGeometryDetElement* detElement
+ = (AliMUONGeometryDetElement*) fDetElements->Get(detElemId);
+ if (!detElement) {
+ AliWarning("Transformation not found.");
return false;
};
- envelope->SetTransform(*kTransform);
+ envelope->SetTransform(*(detElement->GetLocalTransformation()));
return true;
}
// to the list of envelopes.
// ---
- if (fDebug) {
- cout << "... Adding ";
- if (!isVirtual) cout << " non-";
- cout << "virtual envelope " << name
- << " id " << id << endl;
- }
+ if (!isVirtual) AliDebug(1,Form("Adding non-virtual envelope %s id %d",name.Data(),id));
+// else AliDebug(1,Form("Adding virtual envelope %s id %d",name.Data(),id));
AliMUONGeometryEnvelope* envelope
= new AliMUONGeometryEnvelope(name, id, isVirtual, only);
envelope->AddConstituentParam(name, copyNo, transform, npar, param);
}
+//______________________________________________________________________________
+Int_t AliMUONGeometryEnvelopeStore::GetNofDetElements() const
+{
+// Returns the number od envelopes with detElemId>0.
+// ---
+
+ Int_t nofDetElems = 0;
+
+ for(Int_t i=0; i<fEnvelopes->GetEntriesFast(); i++)
+ if ( fEnvelopes->At(i)->GetUniqueID() > 0 ) nofDetElems++;
+
+ return nofDetElems;
+}