Universita' di GenovaINFN Sezione di Genova  
AIRWATCH / EUSO Genova

CloudsBox - source file

// ESAF : Euso Simulation and Analysis Framework
// $Id: CloudsBox.cc,v 1.4 2004/09/28 22:42:07 thea Exp $
// Sylvain Moreggia created May, 19 2004

#include "CloudsBox.hh"
#include <stdexcept>

ClassImp(CloudsBox)
ClassImp(CloudLayer)

//_____________________________________________________________________________
 CloudsBox::CloudsBox() {
    //
    // ctor
    //
}

//_____________________________________________________________________________
 CloudsBox::CloudsBox(Double_t ODtot,Double_t bottom,Double_t top,UInt_t nb) {
    //
    // ctor
    //
    fODtot = ODtot;
    fTop = top;
    fBottom = bottom;
    fNb = nb;
    if(!fNb) throw runtime_error("CloudsBox ctor -> need for at least one layer");
    fWidth = (top - bottom)/fNb;
    CloudLayer* layer = 0;
    for(UInt_t i=0; i<fNb; i++) {
        layer = new CloudLayer;
	if(!layer) throw runtime_error("PB in building CloudLayer object (with new)");
	layer->fTopAlt = fTop - i*fWidth;
	layer->fODloc = fODtot/fNb;
	fLayers.push_back(layer);
    }
}

//_____________________________________________________________________________
 CloudsBox::~CloudsBox() {
    //
    // dtor
    //
    for(UInt_t i=0; i<fLayers.size(); i++) {
        delete fLayers[i];
        fLayers[i] = 0;
    }
}

//_____________________________________________________________________________
 void CloudsBox::GetODprofile(vector<Double_t>& prof) const {
    //
    // Fill prof (which must be passed emtpy) with the list of layers local Optical Depth
    //
    for(UInt_t i=0; i<fNb; i++) {
        prof.push_back(fLayers[i]->fODloc);
    }
}


About Us | EUSO Official Website | Web pages created by Roberto Pesce and Alessandro Thea - Last Update Wed Nov 16 16:57:39 2005 Wed Nov 16 16:29:22 2005