Line data Source code
1 : // @(#) $Id$
2 : // Author: Fons Rademakers 26/11/99
3 :
4 : /**************************************************************************
5 : * Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
6 : * *
7 : * Author: The ALICE Off-line Project. *
8 : * Contributors are mentioned in the code where appropriate. *
9 : * *
10 : * Permission to use, copy, modify and distribute this software and its *
11 : * documentation strictly for non-commercial purposes is hereby granted *
12 : * without fee, provided that the above copyright notice appears in all *
13 : * copies and that both the copyright notice and this permission notice *
14 : * appear in the supporting documentation. The authors make no claims *
15 : * about the suitability of this software for any purpose. It is *
16 : * provided "as is" without express or implied warranty. *
17 : **************************************************************************/
18 :
19 : //////////////////////////////////////////////////////////////////////////
20 : // //
21 : // AliRawNullDB //
22 : // //
23 : //////////////////////////////////////////////////////////////////////////
24 :
25 : #include "AliRawNullDB.h"
26 :
27 :
28 2 : ClassImp(AliRawNullDB)
29 :
30 :
31 : //______________________________________________________________________________
32 : AliRawNullDB::AliRawNullDB(AliRawEventV2 *event,
33 : AliESDEvent *esd,
34 : Int_t compress,
35 : const char* fileName,Int_t basketsize, Long64_t autoflush)
36 0 : : AliRawDB(event, esd, compress, fileName, basketsize, autoflush)
37 0 : {
38 : // Create a new raw DB that will wrtie to /dev/null.
39 :
40 0 : }
41 :
42 : //______________________________________________________________________________
43 : const char *AliRawNullDB::GetFileName() const
44 : {
45 : // Return /dev/null as filename.
46 :
47 0 : return "/dev/null";
48 : }
49 :
50 : //______________________________________________________________________________
51 : Long64_t AliRawNullDB::Close()
52 : {
53 : // Close raw RFIO DB.
54 :
55 0 : if (!fRawDB) return 0;
56 :
57 0 : if (!fRawDB->IsOpen()) return 0;
58 :
59 0 : fRawDB->cd();
60 :
61 : // Write the tree.
62 : Bool_t error = kFALSE;
63 0 : if (fTree)
64 0 : if (fTree->Write() == 0)
65 0 : error = kTRUE;
66 0 : if (fESDTree)
67 0 : if (fESDTree->Write() == 0)
68 0 : error = kTRUE;
69 :
70 : // Close DB, this also deletes the fTree
71 0 : fRawDB->Close();
72 :
73 0 : fTree = NULL;
74 :
75 0 : Long64_t filesize = fRawDB->GetEND();
76 :
77 0 : delete fRawDB;
78 0 : fRawDB = 0;
79 0 : if(!error)
80 0 : return filesize;
81 : else
82 0 : return -1;
83 0 : }
|