#ifndef LCDDETECTORVOLUME_H
#define LCDDETECTORVOLUME_H

// It acts as a repository of detector-subvolume-specific information,
// such as geometry and materials properties.

//#include "Rtypes.h"  
#include "TObject.h"
#include "TString.h"

enum VolumeType {
  VOL_EM   = 1,
  VOL_HAD  = 2,
  VOL_COIL = 3,
  VOL_AIR  = 4,
  VOL_MUON = 5
};

class LCDDetectorVolume : public TObject {
  public:
  LCDDetectorVolume(){} 
  ~LCDDetectorVolume(){} 

  TString    name;
  VolumeType volKind;      // might need CalRecon::VolumeType here
  Double_t   innerR;       // inner radius
  Double_t   outerR;       // outer radius
  Double_t   innerZ;       // min z in the volume
  Double_t   outerZ;       // max z in the volume
  Bool_t     barrel;       // barrel or endcap-type volume?
  Double_t   iLenPerCm;    // interaction lengths per cm
  Double_t   radLenPerCm;  // rad len per cm
  Double_t   field;        // average field in the volume
  Double_t   emEff;        // unused for now 
  Double_t   hadEff;       // unused for now
  TObject*   pNextR;       // points to adjacent volume of larger R
  TObject*   pPrevR;       // points to adjacent volume of smaller R
  TObject*   pNextZ;       // points to adjacent volume of larger Z

  Bool_t isInside(Double_t x, Double_t y, Double_t z);

  // Note: need a special convention to properly interpret pPrevR.  In
  // some cases a volume may be adjacent to two volumes of smaller radius
  // In this case. pPrevR will point to the one of minimal z.  Code
  // following this pointer with regard to a particle at a known position
  // on the boundary will have to check if the new volume contains that
  // point.  If not, follow the pNextZ pointer and try again.

  ClassDef(LCDDetectorVolume,1)//Keep info of interest on each detector volume

};
#endif
